2

I have a list of computer names that I would like to be able to know the IP address of to RDP/VNC from time to time.

I was wondering if there was a way I could look them up? I am using a Mac but the normal

ping PCNAME

doesn't seem to work. Is there an alternative?

3 Answers 3

2
dig hostname

will work on mac to find out IP address, that assumes that your local network dns configuration has the correct results or it exists in global dns

1
  • 1
    Additionally, if you want just the IP address without all the other information, dig hostname +short will get you that. If you're on the same local LAN as the hosts and they have Bonjour/ZeroConf names set, you can use dig computer-name.local +short to get the IPs, even if they don't have DNS entries.
    – morgant
    Jul 21, 2011 at 11:11
1

Try this to resolve names from the DNS:

nslookup PCNAME
hostx PCNAME
host PCNAME
dig PCNAME

One of these should work. If it returns no answer it means your administrator did not configure DNS for them. Then it depends of these are Macs or PCs with Windows.

0

Try

sudo arp-scan -I eth0 -l | perl -ne '/((\d{1,3}.){3}\d{1,3})/ and $ip=$1 and $_=nmblookup -A $ip and /([[:alnum:]-]+)\s+<00>[^<]+/m and printf "%15s %s\n",$ip,$1'

Hope that helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .