Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 http://192.168.1.1/DHCPTable.asp (<< 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 192.168.1.0 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.

Thoughts?

share|improve this question

1 Answer 1

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:

192.168.1.1 (or 192.168.2.1 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:

local

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:
192.168.1.1

Search Domains:
local
ph.cox.net

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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