delegation test tool

delegation test tool

From: Kim Davies <kim§cynosure.com.au>
Date: Wed, 18 Sep 2002 18:25:50 +0200
Quoting CEInternet HelpDesk on Wednesday September 18, 2002:
| 
| I am bewildered as to why redelegation notifications are now being 
| withdrawn by Melbourne IT. Following is Melborne ITs response to our query.
| How are we as an ISP supposed to know that requests are being made to 
| redelegate our customers domains elsewhere.
| 
| We require this to obviously update our DNS when appropriate, or contact 
| our customers in situations where we feel they may have been duped by a 
| fast-talking webhosting company who knows nothing about the way DNS 
| operates.

Further to my earlier emails today, here is a perl script I just
cooked up to tell you when it is broken. Just supply the domain(s) as
arguments.. any noteworthy errors will go to STDERR. Change $msnymask to
a regexp that matches your nameservers that it _should_ be delegated to.

note: script below wont work on broken auth ns implementations, but
this is not a problem with .au :-)

kim


--8<-- snip -----
#!/usr/bin/perl

use Net::DNS;

$mynsmask = '^.*?\.ceinternet\.com\.au$';
$parentauthority = 'ns1.ausregistry.net.au';
 
foreach $domain (&#167;ARGV) {
  my $resolver = Net::DNS::Resolver->new();
  $resolver->nameservers($parentauthority);
  my $packet = $resolver->send($domain.'.', 'NS');
  if ($packet) {
    foreach my $rr ($packet->authority()) {
      if ($rr->type() eq 'NS') {
        if ($rr->nsdname() !~ /$mynsmask/) {
          warn "$domain ns ".$rr->nsdname()." does not match mask $mynsmask\n";
        }
      } elsif ($rr->type() eq 'SOA') {
        warn "$domain returns soa. probably doesn't exist.\n";
      } else {
        warn "odd RR of type ".$rr->type()." in $domain\n";
      }
    }
  } else {
    if ($resolver->errorstring() eq 'NOERROR') {
      warn "no records for $domain\n";
    } else {
      warn "$domain ns query error ".$resolver->errorstring()."\n";
    }
  }
}
Received on Fri Oct 03 2003 - 00:00:00 UTC

This archive was generated by hypermail 2.3.0 : Sat Sep 09 2017 - 22:00:06 UTC