On Sat, 21 Apr 2007, in the Usenet newsgroup comp.os.linux.networking, in
article <PsgWh.490$Fc1.21@trnddc05>, Mark wrote:
>Neroku wrote:
>> Consider I have a host in my LAN called "foo", and it ip address is
>> 172.16.0.1, how can I get the hostname (i.e. foo) from the ip
>> address???
>>
>> nslookup 172.16.0.1 won't work.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Try
>
>host 172.16.0.1
[compton ~]$ whatis dig dnsquery host nslookup
dig (1) - send domain name query packets to name servers
dnsquery (1) - query domain name servers using resolver
host (1) - look up host names using domain server
nslookup (8) - query Internet name servers interactively
[compton ~]$
All four ask a name server for data. If nslookup won't work, neither will
any of the others. These tools don't look in the /etc/hosts files, or
try to use some microsoft name resolution service or the equally insecure
Apple mDNS (implemented as Avahi in Linux service). Trying any form of
network connection will cause the resolver to look through the available
name resolution services defined in /etc/nsswitch.conf, but if they don't
know the name either, you're just as bad off as you were to start with.
Old guy
|