Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find domain name aliases ?? 1

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi all ,

I have IP address of a machine on the network.

How can I find out all possible domain name aliases defined for that machine ?
If there is a way to do this, will it work for internet and intranet both ?

Please guide .

Regards
 
ping -a ipaddress

will print the name if it exists.

ping -a 216.109.127.28

Pinging w1.rc.dcn.yahoo.com [216.109.127.28] with 32 bytes of data:


In Addition, There are DNSLOOKUP programs which will translate ip addresses to names if they exist. Probably find one via your favorite search engine.




---
 
Sorry. I forgot which Forum I was in. try this


use strict;
use Net::hostent;
use Socket;

my $h;
my $destaddr;
my $a;


if ( $#ARGV < 0 )
{
printf("$0 ipaddress ... \n");
exit;
}

foreach $destaddr ( @ARGV )
{

# must translate w.x.y.z string to 4 binary characters
$a = inet_aton($destaddr);

$h = gethostbyaddr($a);

if ( defined ($h) )
{
printf("%s resolved to %s\n",$destaddr,$h->name);
}
else
{
printf("%s can't be resolved\n",$destaddr);
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top