Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Resolving domain names to numeric IP addresses on a LAN

I am trying to get the Computer name <-> IP address table for all of the computers connected to the LAN. Note: All other computers are windows based.

I've used the arp -a command and this returns a table of IP address <-> MAC address but no domain names.

I've tried lookup in network utility but this provides no IP address given a computer name.

MacBook, Mac OS X (10.5.8)

Posted on Jan 13, 2011 11:42 PM

Reply
9 replies

Jan 14, 2011 6:17 AM in response to Jeffrey Young

First, do you have some form of DNS operational on your network? This would usually be traditional DNS or Bonjour, and these are also known as unicast DNS, and Bonjour as multicast DNS or mDNS.

Mac OS X Server and Windows Server and most any other server operating system will offer these DNS services directly, and have GUI tools that directly allow configuration. (Being Unix, Mac OS X client can also offers DNS services, presuming you're willing to set up and manage BIND via the command line.)

Windows clients can send their DHCP registration along via WINS; this is arguably the Windows analog of Bonjour. [Here|http://technet.microsoft.com/en-us/library/cc750589.aspx] and here|http://www.computerperformance.co.uk/w2k3/services/WINS_DNS.htm] is information on Windows networking, and DNS and WINS on Windows. Mac OS X doesn't play all that well with WINS here, and Microsoft seemed to be moving away from WINS when last I was paying attention to things Microsoft.

If you do have DNS, here are the forward and reverse DNS translations using unicast DNS, respectively:

dig host.example.com
dig -x ip.address.here


With Mac OS X, you can also use Network Utility to get at some of the command-line tools and translations via the GUI. Applications > Utilities > Network Utility.

If you want to explore what mDNS is available, see the dns-sd command. (That'll tell you more of what is on your LAN, for devices that do support Bonjour.)

Jan 17, 2011 11:31 PM in response to MrHoffman

Our network only has a modem/router. I assume the router dishes out the IP addresses when a computer is connected to our LAN via DHCP. How do I interrogate the network for hostname <-> IP addresses of currently connected computers / printers ?

If I type:

dig hallway

; <<>> DiG 9.4.3-P3 <<>> hallway
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48084
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;hallway. IN A

;; AUTHORITY SECTION:
. 3600 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2011011701 1800 900 604800 86400

;; Query time: 55 msec
;; SERVER: 203.0.178.191#53(203.0.178.191)
;; WHEN: Tue Jan 18 17:20:59 2011
;; MSG SIZE rcvd: 100


where hallway is the name of a computer on our network, there is no IP address for this computer in dig's response, only some server address. Hallway's IP is currently 192.168.0.64.

I've tried to go to the link on windows networking you provided but it resulted in a blank page.

Jan 18, 2011 5:11 AM in response to Jeffrey Young

Ok, you don't have DNS services here, which means you're either going to get to implement DNS services, or you're going to get to know Bonjour and the dns-sd command mentioned earlier.

Traditional DNS is also known as unicast DNS.

Bonjour implements various bits including what is known as multicast DNS or mDNS.

Mac OS X Server is an option for implementing unicast DNS services. (As does Mac OS X client for that matter, but that's rather more work at the command line than you may want to undertake.)

For multicast DNS operations via DHCP, launch Terminal.app and use the dns-sd command, and query for, for instance, printers or devices with web servers or Airport or Time Capsule devices:

$ dns-sd -B printer.tcp
$ dns-sd -B http.tcp
$ dns-sd -B airport.tcp


If you're looking at this stuff and at this level, then you're at the point where you will want seriously consider rolling out DNS services for your LAN.

Unless you're using DHCP with static addresses configured, the use of DHCP means these device IP addresses can and will vary. Stuff then uses dns-sd queries to locate the service or the device, or checks the DHCP server. (Microsoft tied DHCP into WINS, though that's been something they've discouraged for a while. Some network configurations can have have DHCP tied into DNS services, which is a variation of this.)

And FWIW, hallway isn't what I'd typically use. It'd be something like hallway.local with the Bonjour TLD (and .local should be left to Bonjour and not used elsewhere) or (as I often recommend to folks that are using unicast DNS) get a real and registered domain name and set up hallway.example.com and such.

Jan 19, 2011 11:58 PM in response to MrHoffman

I tried the dns-sd command for printers. It found our network printer. So I tried :
dns-sd -L Brother\ HL-2170W\ series printer.tcp
Lookup Brother HL-2170W series. printer.tcp.local
17:47:15.952 Brother\032HL-2170W\032series. printer.tcp.local. can be reached at BRN001BA9044937.local.:515
txtvers=1 qtotal=1 pdl=application/vnd.hp-PCL rp=duerqxesz5090 ty=Brother\ HL-2170W\ series product=\(Brother\ HL-2170W\ series\) adminurl=http://BRN001BA9044937.local./ priority=75 usb_MFG=Brother usb_MDL=HL-2170W\ series Color=F Copies=T Duplex=F PaperCustom=T Binary=T Transparent=T TBCP=F
^C

Still can't see any IP address.

In the type field of the dns-sd command what would you use to lookup windows PCs connected to the network ?

Jan 20, 2011 7:16 AM in response to Jeffrey Young

Still can't see any IP address.


BRN001BA9044937.local is the host name to target with a +dns-sd -Q+ or +dns-sd -G v4v6+ or a ping to get the current IP address.


$ dns-sd -Q BRNC64716.local
$ dns-sd -G v4v6 BRNC64716.local
$ ping BRNC64716.local


In the type field of the dns-sd command what would you use to lookup windows PCs connected to the network ?


Off the top, and I don't have any Windows boxes on the LAN today to check this, but the Windows boxes would need to have the Apple Bonjour tools loaded and running. This was an optional part of the iTunes and Safari packaging. Windows (by default) uses its own schemes for registration.

For more Bonjour rummaging, Google for and go load the Bonjour Browser widget, and have at.

And I'd tend to suggest getting unicast DNS setup here.

Jan 20, 2011 11:25 PM in response to MrHoffman

I tried ping and yes that worked :

ping BRN001BA9044937.local
PING BRN001BA9044937.local (192.168.0.180): 56 data bytes
64 bytes from 192.168.0.180: icmp_seq=0 ttl=255 time=2.174 ms

I ended up getting the WakeOnLan program and this provided the info I needed - list of all computers and printers on the network with IP addresses.

If I installed bonjour on the windows boxes will they show up as a samba service ?
If so, would the dns-sd command to see these PCs on the network be :

dns-sd -B smb.tcp

Jan 21, 2011 5:29 AM in response to Jeffrey Young

I don't know off-hand if Microsoft Windows boxes will show up as CIFS servers when the Apple Bonjour tools are installed. Try it?

I do run unicast DNS, which is better set up for what you're doing here, and what I'd recommend doing here. You can use Mac OS X client for that, or even a SheevaPlug or GuruPlug if you're inclined to do a little hacking, and using Mac OS X Server makes DNS pretty easy.

And if you think you might ever be interested in running VPNs into or out of this network, get your network address usage out of the 192.168.0.0/24 and 192.168.1.0/24 subbets, and preferably entirely out of the 192.168.0.0/16 block.

Resolving domain names to numeric IP addresses on a LAN

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.