fix trailing '.' whois <-> dig dichotomy

- whois records don't have trailing '.'; NS records do. Add trailing '.'
This commit is contained in:
Brian Cunnie
2016-09-04 06:00:22 -07:00
parent 819c2604dc
commit ae765ae476

View File

@@ -22,12 +22,14 @@ check_domain(domain)
puts "[PASS] #{domain} basic check ('DOMAIN' variable set & not empty)" puts "[PASS] #{domain} basic check ('DOMAIN' variable set & not empty)"
whois_nameservers = get_whois_nameservers(domain) whois_nameservers = get_whois_nameservers(domain)
#whois_nameservers = [ 'ns-aws.nono.com', 'ns-he.nono.com' ] # testing #whois_nameservers = [ 'ns-aws.nono.io', 'ns-he.nono.io', 'ns-gce.nono.io' ] # testing
# whois records don't have trail '.'; NS records do; add trailing '.'
whois_nameservers.map { |ns| ns << '.' }
puts "[PASS] #{domain} has whois entry with nameservers #{whois_nameservers.join(", ")}" puts "[PASS] #{domain} has whois entry with nameservers #{whois_nameservers.join(", ")}"
whois_nameservers.each do |whois_nameserver| whois_nameservers.each do |whois_nameserver|
dig = `dig +short ns sslip.io @#{whois_nameserver}` dig = `dig +short ns sslip.io @#{whois_nameserver}`
dig_nameservers = dig.split(/\n+/) dig_nameservers = dig.split(/\n+/)
if ( whois_nameservers.sort == dig_nameservers.sort ) if ( whois_nameservers.sort == dig_nameservers.sort )
puts "[PASS] #{whois_nameserver}'s NS records match whois" puts "[PASS] #{whois_nameserver}'s NS records match whois"
else else