name server

Aaron Y.T. Cheung aaron at ux.acs.umn.edu
Mon Sep 10 18:33:48 AEST 1990


| Does anyone know how to obtain the hostname of a machine given the IP
| address using a name server (the nslookup feature of unix?) ?


Try the reverse mapping -- nslookup with the PTR type:

Eg, to get the hostname of IP address 128.101.63.2,

nslookup> set q=ptr
nslookup> 2.63.101.128.in-addr.arpa.    (note that the IP is supplied reversed)

for the convenience of querying multiple IP's, 

nslookup> set q=ptr
nslookup> set do=in-addr.arpa.
nslookup> 2.63.101.128
nslookup> 1.63.101.128
etc.

Works only if the IP address is connected to the Internet and someone
did register his corresponding network.in-addr.arpa domain with Nic
and someone actually put in the ptr records for their hosts and their
primary and secondary nameservers are not down and.... :-)

Hope it helps.

/aaron.



More information about the Comp.unix.admin mailing list