find_lamers.pl
- Decided to take it at 7pm last night
- Basic framework is running but start running into edge cases
- Eg: the nz root servers don't seem to have any additional records for the org.nz zone.
- Realise I'm essentially writing a recursive nameserver in perl
- Net::DNS makes this easy, but not _that_ easy that _I_ can write it in 2 hours.
my $res = Net::DNS::Resolver->new(
nameservers => [$nameserver],
recurse => 0,
debug => 0,
);
my $packet = $res->send($domain, "NS");
if ($packet) {
if ($packet->header->nscount) {
foreach my $rr ($packet->authority) {
my $name = lc($rr->rdatastr);
$name =~ s{ . \z }{}xms;
$data->{$domain}{$level}{authority}{$name}{name} = $name;
}
}