[Mimedefang] Net::DNS referral section for a Domain?
Kevin A. McGrail
KMcGrail at PCCC.com
Thu Nov 13 17:44:24 EST 2014
Trying to do some checks on spam by nameservers but I can't figure out
how to find the referral nameservers for a domain from the root servers.
For example, this snippet is NOT what I need, I don't think:
use Net::DNS;
my $res = Net::DNS::Resolver->new;
my $reply = $res->query("pccc.com", "NS");
if ($reply) {
foreach $rr (grep { $_->type eq 'NS' } $reply->answer) {
print $rr->nsdname, "\n";
}
}
else {
warn "query failed: ", $res->errorstring, "\n";
}
This snippet gets the SOA records which don't have to agree with whois,
for example:
ns3.pccc.com
ns.2rad.net
ns.pccc.com
ns2.pccc.com
But perhaps it's because our system will check and the servers are
authoritative.
What we want is the equivalent of a dig +trace referral record which
would be:
;; Received 486 bytes from 198.41.0.4#53(a.root-servers.net) in 9 ms
pccc.com. 172800 IN NS ns.pccc.com.
pccc.com. 172800 IN NS ns2.pccc.com.
pccc.com. 172800 IN NS ns3.pccc.com.
Any thoughts on how to do that programmatically with Net::DNS?
Regards,
KAM
More information about the MIMEDefang
mailing list