Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to get hostname from IP address???

Reply
Thread Tools Display Modes

How to get hostname from IP address???

 
 
Neroku
Guest
Posts: n/a

 
      04-18-2007, 10:50 PM
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.

TIA

 
Reply With Quote
 
 
 
 
Joe Pfeiffer
Guest
Posts: n/a

 
      04-19-2007, 12:11 AM
Neroku <(E-Mail Removed)> writes:

> 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.


Then 172.16.0.1 isn't in the reverse DNS lookup tables. If it were,
nslookup would work. So, for instance, I can get:

snowball:603$ nslookup 192.168.0.13
Server: 192.168.0.2
Address: 192.168.0.2#53

13.0.168.192.in-addr.arpa name = zoya.wb.comcast.net.
 
Reply With Quote
 
Llanzlan Klazmon the 15th
Guest
Posts: n/a

 
      04-19-2007, 12:43 AM
Neroku <(E-Mail Removed)> wrote in news:1176936630.382899.161850
@d57g2000hsg.googlegroups.com:

> 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.


Maybe your DNS server is missing the PTR record.

Klazmon



>
> TIA
>


 
Reply With Quote
 
Mark
Guest
Posts: n/a

 
      04-21-2007, 04:31 AM
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.
>
> TIA


Try

host 172.16.0.1

On my Centos 5 installation, that shows the
hostname as the last word on the line of output.

Mark
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      04-22-2007, 01:04 AM
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mac address & hostname automatic randomizer freeware for Windows jhailey@hotmail.com Wireless Internet 23 12-23-2008 10:23 PM
how to resolve IP address to hostname arturo1957 Linux Networking 7 03-11-2007 06:18 PM
can't get internal ip address when ping hostname Fong Windows Networking 2 02-17-2006 03:04 AM
Configuring hostname, domainname, and IP address linuxquestion@yahoo.com Linux Networking 38 01-10-2004 12:54 AM
Problem with Hostname changing to IP Address Nathan Given Linux Networking 6 09-17-2003 02:37 PM



1 2 3 4 5 6 7 8 9 10 11