*** dnswalk.1.8.1/README Sun Jul 24 16:33:15 1994 --- README Sun Jul 24 16:33:57 1994 *************** *** 1,7 **** ! dnswalk 1.8 - June 1994 Author: David Barr ! $Id: README,v 1.3 1994/06/27 14:13:44 barr Exp barr $ INTRO --- 1,7 ---- ! dnswalk 1.8.2 - June 1994 Author: David Barr ! $Id: README,v 1.4 1994/07/24 20:33:54 barr Exp barr $ INTRO *** dnswalk.1.8.1/CHANGES Sun Jul 24 16:33:23 1994 --- CHANGES Sun Jul 24 16:33:50 1994 *************** *** 1,4 **** ! $Id: CHANGES,v 1.4 1994/06/27 14:13:38 barr Exp barr $ Version 1.8.1 One-line fix to remove reference to non-existent parameter to getmaster(). Reported by petri@ibr.cs.tu-bs.de (Stefan Petri). --- 1,13 ---- ! $Id: CHANGES,v 1.7 1994/07/24 20:33:43 barr Exp barr $ ! Version 1.8.2 ! Fixed spelling errors and shoddy syntax in getauthservers(), from ! Jost Krieger ! ! Accounted for Solaris's broken gethostbyname() which includes trailing ! dots in retuned name. ! ! Minor fixes in lame delegation checking, and getauthservers(). ! Version 1.8.1 One-line fix to remove reference to non-existent parameter to getmaster(). Reported by petri@ibr.cs.tu-bs.de (Stefan Petri). *** dnswalk.1.8.1/dnswalk Sun Jul 24 16:33:23 1994 --- dnswalk Sun Jul 24 16:34:18 1994 *************** *** 2,8 **** # dnswalk Walk through a DNS tree, pulling out zone data and # dumping it in a directory tree # ! # $Id: dnswalk,v 1.9 1994/06/27 14:13:24 barr Exp barr $ # # check data collected for legality using standard resolver # --- 2,8 ---- # dnswalk Walk through a DNS tree, pulling out zone data and # dumping it in a directory tree # ! # $Id: dnswalk,v 1.11 1994/07/24 20:34:14 barr Exp barr $ # # check data collected for legality using standard resolver # *************** *** 65,71 **** } } } ! # try to get a zone transfer, trying each listed authoratative server if # if fails. sub doaxfr { local ($domain)=@_[0]; --- 65,71 ---- } } } ! # try to get a zone transfer, trying each listed authoritative server if # if fails. sub doaxfr { local ($domain)=@_[0]; *************** *** 75,81 **** # error handling ($path=&host2path($domain)) =~ tr/A-Z/a-z/; local(@servers) = &getauthservers($domain); ! &printerr("warning: $domain has only one authoratative nameserver\n") if (scalar(@servers) == 1); &printerr("warning: $domain has NO authoritative nameservers!\n") if (scalar(@servers) == 0); if ((-f "$basedir/$path/axfr") && (!$main'opt_f)) { open(DIG,"<$basedir/$path/axfr") || die "cannot open $basedir/$path/axfr: $!\n"; --- 75,81 ---- # error handling ($path=&host2path($domain)) =~ tr/A-Z/a-z/; local(@servers) = &getauthservers($domain); ! &printerr("warning: $domain has only one authoritative nameserver\n") if (scalar(@servers) == 1); &printerr("warning: $domain has NO authoritative nameservers!\n") if (scalar(@servers) == 0); if ((-f "$basedir/$path/axfr") && (!$main'opt_f)) { open(DIG,"<$basedir/$path/axfr") || die "cannot open $basedir/$path/axfr: $!\n"; *************** *** 197,209 **** local ($s); open(DIG,"dig +noau ns $_[0] 2>/dev/null|"); local(@servers)=(); ! local(@servhash)=(); while () { chop; tr/A-Z/a-z/; if (/\S+\s+\d+\s+ns\s+(\S+)/) { $s=$1; ! if ($s eq $master) { $foundmaster=1; # make sure the master is at the top } else { push(@servers,$s) if ($servhash{$s}++<1); --- 197,209 ---- local ($s); open(DIG,"dig +noau ns $_[0] 2>/dev/null|"); local(@servers)=(); ! local(%servhash)=(); while () { chop; tr/A-Z/a-z/; if (/\S+\s+\d+\s+ns\s+(\S+)/) { $s=$1; ! if (&equal($s,$master)) { $foundmaster=1; # make sure the master is at the top } else { push(@servers,$s) if ($servhash{$s}++<1); *************** *** 212,218 **** } close(DIG); if ($foundmaster) { ! unshift(servers,$master); } return @servers; } --- 212,218 ---- } close(DIG); if ($foundmaster) { ! unshift(@servers,$master); } return @servers; } *************** *** 288,294 **** if (!$name) { &printerr(" $_[0] PTR $_[3]: unknown host\n"); } ! elsif (!&equal(($name.'.'),$_[3])) { &printerr(" $_[0] PTR $_[3]: CNAME (to $name)\n"); } elsif (!&matchaddrlist($_[0])) { --- 288,294 ---- if (!$name) { &printerr(" $_[0] PTR $_[3]: unknown host\n"); } ! elsif (!&equal($name,$_[3])) { &printerr(" $_[0] PTR $_[3]: CNAME (to $name)\n"); } elsif (!&matchaddrlist($_[0])) { *************** *** 307,313 **** if (!$name) { &printerr(" $_[0] A $_[3]: no PTR record\n"); } ! elsif ($opt_F && !&equal($name.".",$_[0])) { &printerr(" $_[0] A $_[3]: points to $name\n") if ((split(/\./,$name,1))[0] ne "localhost"); } if ($main'opt_a) { --- 307,313 ---- if (!$name) { &printerr(" $_[0] A $_[3]: no PTR record\n"); } ! elsif ($opt_F && !&equal($name,$_[0])) { &printerr(" $_[0] A $_[3]: points to $name\n") if ((split(/\./,$name,1))[0] ne "localhost"); } if ($main'opt_a) { *************** *** 331,337 **** else { if (!$name) { &printerr(" $_[0] NS $_[3]: unknown host\n"); ! } elsif (!&equal(($name.'.'),$_[3])) { &printerr(" $_[0] NS $_[3]: CNAME (to $name)\n"); } } --- 331,337 ---- else { if (!$name) { &printerr(" $_[0] NS $_[3]: unknown host\n"); ! } elsif (!&equal($name,$_[3])) { &printerr(" $_[0] NS $_[3]: CNAME (to $name)\n"); } } *************** *** 346,352 **** if (!$name) { &printerr(" $_[0] MX $_[3]: unknown host\n"); } ! elsif (!&equal(($name.'.'),$mx)) { &printerr(" $_[0] MX $_[3]: CNAME (to $name)\n"); } } --- 346,352 ---- if (!$name) { &printerr(" $_[0] MX $_[3]: unknown host\n"); } ! elsif (!&equal($name,$mx)) { &printerr(" $_[0] MX $_[3]: CNAME (to $name)\n"); } } *************** *** 358,364 **** else { if (!$name) { &printerr(" $_[0] CNAME $_[3]: unknown host\n"); ! } elsif (!&equal(($name.'.'),$_[3])) { &printerr(" $_[0] CNAME $_[3]: CNAME (to $name)\n"); } } --- 358,364 ---- else { if (!$name) { &printerr(" $_[0] CNAME $_[3]: unknown host\n"); ! } elsif (!&equal($name,$_[3])) { &printerr(" $_[0] CNAME $_[3]: CNAME (to $name)\n"); } } *************** *** 384,389 **** --- 384,397 ---- # Do case-insensitive string comparisons local ($one)= $_[0]; local ($two)= $_[1]; + $stripone=$one; + if (chop($stripone) eq '.') { + $one=$stripone; + } + $striptwo=$two; + if (chop($striptwo) eq '.') { + $two=$striptwo; + } $one =~ tr/A-Z/a-z/; $two =~ tr/A-Z/a-z/; return ($one eq $two); *************** *** 422,428 **** sub checklamer { local ($isauth)=0; local ($error)=0; ! # must check twice, since first query may be authoratative # trap stderr here and print if non-empty open(DIG,"dig soa +noaa $_[0] \@$_[1] 2>&1 1>/dev/null |"); while () { --- 430,436 ---- sub checklamer { local ($isauth)=0; local ($error)=0; ! # must check twice, since first query may be authoritative # trap stderr here and print if non-empty open(DIG,"dig soa +noaa $_[0] \@$_[1] 2>&1 1>/dev/null |"); while () { *************** *** 434,439 **** --- 442,455 ---- return if $error; open(DIG,"dig soa +noaa $_[0] \@$_[1] 2>/dev/null|"); while () { + if (/status: NXDOMAIN/) { + $isauth=0; + last; + } + if (/status: SERVFAIL/) { + $isauth=0; + last; + } if (/;; flags.*aa.*;/) { $isauth=1; }