sesh / ready

Are you production ready?
ISC License
26 stars 4 forks source link

nameserver check fails if subdomain is not 'www' #36

Open mejofi opened 4 months ago

mejofi commented 4 months ago

It looks the ns_minimum_count check fails if a subdomain is used, and that subdomain is not 'www'. For example;

$ ready --check-filter=nameserver www.ur.nl
URL (no scheme): www.ur.nl, Domain (no path): www.ur.nl, Second Level Domain: ur.nl
[ OK ] At least two nameservers should be provided (['ur.nl.', 'fay.ns.cloudflare.com.', 'luke.ns.cloudflare.com.'])

$ ready --check-filter=nameserver e.ur.nl
URL (no scheme): e.ur.nl, Domain (no path): e.ur.nl, Second Level Domain: ur.nl
[FAIL] At least two nameservers should be provided (['web.flowmailer.net.'])

The value returned in the second example is the CNAME record, not the NS records for that subdomain, as none exist. It is technically possible that it could be delegated, so it is not a bad idea to check, but that should be for NS records specifically, with a fallback to the level above it.

The simplest solution would be to always check the second-level domain only, which is also what happens for the 'www' record.