Finding out domain name from IP number with nslookup. How?

Gary Weimer 588-0953 weimer at garden.kodak.COM
Wed Feb 20 05:12:06 AEST 1991


In article <191 at wrdis01.af.mil> you write:
|> In article <4800 at gdc.portal.com> lee at gdc.portal.com (Seng-Poh Lee,
Gen DataComm, +1 203 758-1811) writes:
|> >A while back I saw something posted regarding how to find out  a domain
|> >name based on the IP number, using nslookup. It had something to do with
|> >some option within nslookup but I don't remember what it was.
|> >
|> Lets say you are looking for 26.6.0.83 (thats me)
|> 
|> You get into nslookup and type the following
|> 
|> set type=any
|> 
|> then
|> 83.0.6.26.in-addr.arpa
|> and you should then get the host.domain info....
|> 
|> or you type
|> set type=PTR
|> then 83.0.6.26.in-addr.arpa
|> and you should then get the host.domain info....

I prefer to use the aliases:

alias ns     '(echo server ispdgate;echo set q=any;echo \!*)|nslookup|grep \!*'
alias _nsn   'echo \!*|awk -F. '\''{print $4"."$3"."$2"."$1".in-addr.arpa"}'\'
alias nsn    '(echo server ispdgate;echo set q=PTR;_nsn
\!*)|nslookup|grep host'

ns is an nslookup by name (i.e. ns host.domain)
_nsn is used by nsn
nsn is an nslookup by number (i.e. nsn 26.6.0.83)

nsn basically does what the previous posting does, filtering out the
connect messges, etc. If you want to know the name server being used,
remove the grep command from ns and nsn.

weimer at ssd.kodak.com ( Gary Weimer )



More information about the Comp.unix.questions mailing list