Check that whois matches dig

This commit is contained in:
Brian Cunnie
2016-09-02 08:03:44 -07:00
parent 24aee3e7b2
commit 6cb6eaa17f

View File

@@ -20,4 +20,16 @@ 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)
puts "[PASS] #{domain} has whois entry with nameservers" #whois_nameservers = [ 'ns-aws.nono.com', 'ns-he.nono.com' ] # testing
puts "[PASS] #{domain} has whois entry with nameservers #{whois_nameservers.join(", ")}"
whois_nameservers.each do |whois_nameserver|
dig = `dig +short ns sslip.io #{whois_nameserver}`
dig_nameservers = dig.split(/\n+/)
if ( whois_nameservers.sort == dig_nameservers.sort )
puts "[PASS] #{whois_nameserver}'s NS records match whois"
else
puts "[FAIL] #{whois_nameserver}'s NS records do NOT match whois: #{dig_nameservers.join(", ")}"
end
#p "#{whois_nameserver}: #{nameservers}"
end