I have a few Windows computers and two Mac computers all on the same router. The Windows computers can find each other by hostname just fine, so for example a UNC path of \\HOSTNAME\SHARE would resolve without error. I suppose the Windows computers are still using some kind of NetBIOS over TCP/IP to pull this off or something, surely they must be broadcasting hostname resolution requests to the subnet. But when I'm on the Macs, I have to "sudo vim /etc/hosts" to statically set the IP address of each of the Windows computer if I want to connect to a Windows share via SMB as smb://HOSTNAME/SHARE. Fortunately, my router exposes the DHCP clients in a browseable table at (<< this URL will only resolve on my network, or on yours if you have a Cisco-Linksys E4200 or other router with a similar web admin and a subnet).

Anyway, I was just wondering if there was some way to automate this on the Mac, so that either DNS resolution goes through some kind of configurable filter that might do NetBIOS or something, or else that automatically updates the entries in /etc/hosts somehow.

I suppose ideally the router should do this in a dynamic DNS implementation so that the Mac would prioritize the router as its DNS resolver and the router would check its DHCP clients table first, but I don't think mine does. (Again, it's a Cisco-Linksys E4200.) EDIT: Actually, this router does support DDNS but it's for public DDNS not local DDNS as with WINS.



OK. I figured this out, sort of. The router does do local dynamic DNS and it does serve up for local DHCP clients.

In the Mac network settings under Advanced, under the DNS tab, the default DNS servers are probably provisioned by the ISP and as such are predefined and gray. Clicking the '+' button will automatically replace (delete) them with what you enter. Enter the router IP: (or or whatever the router's IP really is)

Then for the "Search Domains" area, the default domain provisioned by the internet provider (in my case ph.cox.net because I'm a COX broadband user in the Phoenix metro) is predefined and gray; clicking the '+' button will automatically replace (delete) this with what you enter. Enter the same value:

ph.cox.net (again, except matching your own ISP's domain as was already showing)

Click the '+' again to add another entry above it to enter:


Open a terminal and try to ping a Windows server. It should resolve as servername.local.

In the end, this is what I have:

DNS Servers:

Search Domains:

Follow-up: Unfortunately, this only works on some of my devices. I'm still not getting all of the hosts that appear in the DHCP Clients list to resolve, only a few of them in fact.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.