D
demolitionz
Wonder if anyone can help? Basically i want to specify an ip address
via stdin and for the program to then go on to a reverse dns lookup
webpage and return the domain name given on that page. I've got as far
as sending the ip addy to the dns lookup website and successfully
receiving a response page, but now i don't know how to return the
domain name shown on the response page. Anyone have any ideas? Script
is below + I'm still v new to perl so it's rather lame but seems to
work!
#!usr/bin/perl
use Strict;
use Warnings;
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
my $url = 'http://remote.12dt.com/rns/';
print "Ip Address: ";
my $ipaddy = <STDIN>;
chomp $ipaddy;
my $response = $browser->post( $url, [ 'ip' => $ipaddy ] );
if ($response->is_success) {
if ($response->content =~ m/resolves to/i) {
print "Received Reply, now how do i get the address which follows?!\n";
}
else { print "IP lookup failed" }
}
else { die "Connection Error" }
exit;
via stdin and for the program to then go on to a reverse dns lookup
webpage and return the domain name given on that page. I've got as far
as sending the ip addy to the dns lookup website and successfully
receiving a response page, but now i don't know how to return the
domain name shown on the response page. Anyone have any ideas? Script
is below + I'm still v new to perl so it's rather lame but seems to
work!
#!usr/bin/perl
use Strict;
use Warnings;
use LWP::UserAgent;
my $browser = LWP::UserAgent->new;
my $url = 'http://remote.12dt.com/rns/';
print "Ip Address: ";
my $ipaddy = <STDIN>;
chomp $ipaddy;
my $response = $browser->post( $url, [ 'ip' => $ipaddy ] );
if ($response->is_success) {
if ($response->content =~ m/resolves to/i) {
print "Received Reply, now how do i get the address which follows?!\n";
}
else { print "IP lookup failed" }
}
else { die "Connection Error" }
exit;