LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Get hostname from IP address on internal network (https://www.linuxquestions.org/questions/linux-newbie-8/get-hostname-from-ip-address-on-internal-network-598343/)

tekmann33 11-09-2007 08:49 AM

Get hostname from IP address on internal network
 
I am a lowly Systems Tech at a company and I am assigning IP addresses to laptops to be added to the domain.

I am trying to give laptop number 33 the private IP 10.3.0.33, but it looks like another computer has that address already.

I have a Fedora 6 machine on the network and I can ping the 10.3.0.33 address, but is there a way that I can pull its hostname to figure out which one it is?

TB0ne 11-09-2007 09:10 AM

Try "nslookup <ip address>", and it will return a host name. This will only work, though, if that address is in DNS, or is somehow defined.

tekmann33 11-09-2007 09:23 AM

No, our PC's on the internal network are not defined in the DNS server.

bathory 11-09-2007 09:26 AM

Quote:

Try "nslookup <ip address>", and it will return a host name. This will only work, though, if that address is in DNS, or is somehow defined.
This is a samba command and uses netbios and not dns to get names/IPs. You need samba installed in your system to use it. The correct syntax to get the computer name from the IP is
Code:

nmblookup -A xx.xx.xx.xx

tekmann33 11-09-2007 09:44 AM

Beautiful!

Thankyou!


All times are GMT -5. The time now is 04:39 PM.