From ae765ae47689020f5ff6ed8013cb4f4663ac102e Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Sun, 4 Sep 2016 06:00:22 -0700 Subject: [PATCH] fix trailing '.' whois <-> dig dichotomy - whois records don't have trailing '.'; NS records do. Add trailing '.' --- ci/tasks/check-dns.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/tasks/check-dns.rb b/ci/tasks/check-dns.rb index b6d19d0..f48b559 100755 --- a/ci/tasks/check-dns.rb +++ b/ci/tasks/check-dns.rb @@ -22,12 +22,14 @@ check_domain(domain) puts "[PASS] #{domain} basic check ('DOMAIN' variable set & not empty)" 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(", ")}" whois_nameservers.each do |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 ) puts "[PASS] #{whois_nameserver}'s NS records match whois" else