Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Better way to check reverse DNS entries

by ctilmes (Vicar)
on Apr 22, 2003 at 12:57 UTC ( [id://252255]=note: print w/replies, xml ) Need Help??


in reply to Better way to check reverse DNS entries

#!/usr/bin/perl use Net::DNS $res = Net::DNS::Resolver->new; for($c = 0; $c <= 255; $c++) { for($d = 0; $d <= 255; $d++) { print "81.86.$c.$d" unless $res->query("81.86.$c.$d", "PTR"); } }

Replies are listed 'Best First'.
Re: Re: Better way to check reverse DNS entries
by Improv (Pilgrim) on Apr 22, 2003 at 13:06 UTC
    foreach $c (0..255) { foreach $d (0..255) { print "81.86.$c.$d" unless $res->query("81.86.$c.$d", "PTR"); } }
Re: Re: Better way to check reverse DNS entries
by DrManhattan (Chaplain) on Apr 22, 2003 at 18:20 UTC
    Here's something a bit different:
    #!/usr/bin/perl -l use strict; use Net::Netmask; use Socket; gethostbyaddr(inet_aton($_), AF_INET) or print for Net::Netmask->new("81.86.0.0/16")->enumerate();

    -Matt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://252255]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found