1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HOWTO: Configure Tomato to publish static DHCP entries via WINS

Discussion in 'Tomato Firmware' started by HunterZ, Jul 28, 2013.

  1. HunterZ

    HunterZ LI Guru Member

    So I realized that the Windows boxes on my LAN were not attempting to resolve LAN hostnames via the Dnsmasq DNS server running on my Tomato install.

    After lots of Googling, I found what I think is the best router-side solution: http://tomatousb.org/tut:configure-windows-network-browsing

    Basically, Tomato can run a samba/WINS server, and doing so will cause it to publish ALL static DHCP entries via WINS. I verified this by pinging a hostname defined in Tomato's static DHCP list that was not actually currently on the LAN; Windows was able to resolve it to the defined IP address.

    By following the guide, no special client configuration is needed. I love Tomato!

    Edit: See post #6 in this thread for a way to do solve this issue without using samba/WINS/NetBIOS.
    Marcel Tunks likes this.
  2. RonV

    RonV Network Guru Member

    Hmmm...the order of resolution by windows is:

    1. Cache
    2. Local Host File
    3. DNS
    4. LLMNR (Link Local Multicast Name Resolution )
    5. NetBIOS

    WINS falls under NetBIOS resolution but I surprised that the DHCP server in the router was not providing name resolution. LLMNR supports both IPv4 and IPv6 and should have resolved the name before reaching a NetBIOS resolution which is usually H-Node (query Wins first then Broadcast).

    Do you have any special firewall rules on your machines or network discovery turned off?
  3. HunterZ

    HunterZ LI Guru Member

    I was able to verify via Dnsmasq logging that Windows does not contact the DNS server to resolve LAN hostnames if you are not in a domain. Instead, Windows *only* uses WINS/NetBIOS resolution.

    I discovered in my Google searching that adding a period '.' to the end of a LAN hostname will cause Windows to contact the DNS server. You can even force this behavior by configuring a connection's advanced IPv4 settings to automatically append a '.' "domain" to the end of LAN hostnames, but that would have to be set on each Windows machine on the LAN.

    I disable the Windows firewall on my LAN machines, and do not run any third-party firewall software.

    I have no doubt that this is "standard" Windows behavior when not part of a domain. It's easy to replicate too: disable the Tomato Samba/WINS server, add some static DHCP entries to Tomato, enable Tomat's Dnsmasq DNS server, and attempt to ping the static DHCP hostnames from Windows. You will see that Windows fails to resolve the hostnames.
  4. RonV

    RonV Network Guru Member

    You can put a local domain name in your router configuration. Just don't tack on a .org, .com, .edu, etc.

    Just go into the basic settings/identification and for domain name just use say "hunterz" as your domain name. Don't put any "." Then refresh your hosts with a IPCONFIG /renew command and see if that solves this issue.
  5. HunterZ

    HunterZ LI Guru Member

    I tried that with "localnet", as I read that that was common. It makes no difference, though, because Windows knows that it's not part of a domain unless you set up an Active Directory domain controller and/or again succumb to per-machine configuration.

    I even tried configuring Dnsmasq to use "localnet" as its configured domain.

    I'm really, really convinced that the problem is on the Windows side, and that the resolution order you posted is only valid for Windows machines that are configured to be part of a real domain via an Active Directory domain controller (here is someone else saying the same thing, for example: http://superuser.com/questions/4807...tnames-via-dns-when-not-connected-to-a-domain ). Otherwise Windows apparently completely skips DNS resolution (and I guess LLMNR - I guess Dnsmasq doesn't support it?) for LAN hostnames.
  6. HunterZ

    HunterZ LI Guru Member


    I think I've found an alternate solution (from http://www.dd-wrt.com/wiki/index.php/DNSMasq_as_DHCP_server#Using_Web-Admin ), but I'm not sure if I like it as much:

    Basically, set a domain name in Basic->Network (which will cause Tomato to also automatically configure the domain= setting in Dnsmasq), then add "local=/mydomain/" to the Dnsmasq custom configuration box under Advanced->DHCP/DNS.

    Now when you ping a LAN hostname, Windows will show it as hostname.mydomain instead of just hostname.

    ipconfig /all shows that mydomain is set as the connection-specific DNS suffix.

    I'm not sure if I like using this phony domain stuff just to force Windows to go to the DNS server to resolve LAN hostnames, but at least it's a second option that doesn't require client-side configuration.

Share This Page