in reply to Better way to check reverse DNS entries
All I can say is how I would code it. Whether that is "better" or not, I leave to you. Afterall, it's your code, you get to decide what is better.
#!/usr/bin/perl use strict; use warnings; use Net::DNS; my $res = Net::DNS::Resolver -> new; my $net = "81.86"; foreach my $c (0x00 .. 0xFF) { foreach my $d (0x00 .. 0xFF) { my $ip = "$net.$c.$d"; print $ip unless $res -> query ($ip => 'PTR') } } __END__
I used 0x00 .. 0xFF instead of 0 .. 255 purely for aesthetic values.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Better way to check reverse DNS entries
by !unlike (Beadle) on Apr 22, 2003 at 13:25 UTC |