Ping Command In Unix
Wednesday, February 9th, 2011
Find a hostname from an IP on LAN (read details)?
Hey. Please excuse me if this question seems a bit harsh, but I have asked it over and over again on tons of different forums and no one seems to understand what I am asking even though I believe that it is a very simple question. I am wondering how you can find a hostname from an IP address on your LAN in the *unix* command line on a Mac OS X 10.6.
Unix is emphasized here because I have gotten several responses for DOS telling me to do “ping -a x.x.x.x” which doesn’t work in unix.
Also, keep in mind that this is on my *LAN*. Nslookup and dig don’t work and I assume it is because of this.
Finally, do not point me on to nmap, because I have nmap and for some reason doing “nmap -O x.x.x.x” does not give you a hostname (I have had at least five people tell me to try this).
Thank you in advance if you actually have the answer!
i doubt its that anyone doesn’t understand you, because your question makes perfect sense. You seem to not understand how the mechanisms that convert between names and numbers work. In unix, on which OSX is based, this is done by nameservers, and there should be at least one machine set up to do this on your local lan. If not, then you will not be able to use hostnames to connect to other machines, just ip addresses. If you know which name goes to each ip, the easiest way to do this is edit the /etc/hosts file. you may need to also edit /etc/resolv.conf to look there. there is an assload of info on how to do this if you know how to use google. if you want to set up nameservice, you will need more than a couple of half ass answers here to help you. there are many good books out there on this, by o’reilly and such. if you are too cheap to buy them, try the library.
Hping