Welcome to WebmasterWorld Guest from 54.166.33.25

Forum Moderators: coopster & jatar k & phranque

Name to IP conversion in perl?

   
5:33 pm on Aug 1, 2000 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Ok, I have IP to domain name conversion down pat. I was just presented with a task of going the other way from Domain name to IP. What is the fastest way in perl?
2:02 am on Aug 2, 2000 (gmt 0)

WebmasterWorld Senior Member littleman is a WebmasterWorld Top Contributor of All Time 10+ Year Member



This works,
use Socket;
$sitename = 'domain.com';
$address = inet_ntoa(inet_aton($sitename));
print $address;

It may be the fastest.

6:31 pm on Aug 2, 2000 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



ouch. That is so easy it is embarassing.
6:40 pm on Aug 2, 2000 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Final edition:

use Socket;

&dresolve('webmasterworld.com');
&dresolve('searchengineworld.com');

sub dresolve {
$sitename =shift;
$ba =inet_aton($sitename);
$address ="Not valid";
if ($ba) {
$address = inet_ntoa($ba)
}
print "$sitename $address \n";
}

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month