I have Windows and Linux machines on the same subnet. My router configuration correctly tells me both their machine names, and their IP addresses. However, when I try and ping a Linux machine from a Windows machine, or ping a Windows machine from a Linux machine, I need to use IP addresses rather than names. If I'm pinging a Windows machine from a Windows machine, or a Linux machine from a Linux machine, the machine name correctly resolves without any hosts file entries.

Why is this?

I would have thought my router (D-Link DIR-655) would act as a DNS server itself. I see it has an option called "Enable DNS Relay", but from what I've read this won't help me. If it's relevant, the DIR-655 is used for internal traffic, with my ISP's Netgear DGN1000 used as a gateway to the Internet. It's on a different subnet though, and all my machines connect to my DIR-655, not the DGN1000.

What do I need to do to have host names automatically resolved within my subnet regardless of the operating system that they're running?


You need a name resolution server of some sort.

First setup a DNS server that accepts dynamic updates on one machine that has a static IP. BIND is the obvious choice (installs on Windows and Linux) but there are other Linux versions that work just as well such as DJBDNS etc... Your DNS server will need to forward requests to your ISP's DNS server or to some other public DNS server. A good domain name that should be safe enough to use is "home.internal" No need to register it and it is not a public domain... This machine you set DNS onto will need to be up all the time...

Once that is setup, tell your reouter's DHCP server to hand out the IP of the DNS server you just setup.

  • This sounds like my best option. I am still a little confused as to why the router itself doesn't include this functionality - it seems like the most logical place for it. Fortunately, I do have a box that will always be up, so I can use that as a DNS server. Thanks. – Kent Boogaart Sep 18 '11 at 8:07

ARP host names are different from NetBIOS names.

Windows bases itself on NetBIOS names where as Linux bases itself on the host names.

Your router receives the host names through ARP / DHCP; yes, Windows does have host names too.

You need to have your router host the hostnames in it's DNS or you'll need to adjust all the hosts file.

If your router doesn't support it, you could look into installing DD-WRT on your router and using dnsmasq together with a hosts file where you will fill in the hosts. I would deem that's pretty much a work-around though, do you really want to do this just to be able to ping? Not a daily computer activity...

  • It's not about pinging. It's about just day-to-day usage. Puttying from a Windows machine to a Linux one, connecting to a share in either direction, etc. Thanks for the answer. – Kent Boogaart Sep 17 '11 at 14:34

I know your pain, it's completely insane that in 2011, host names don't just "work", right out of the box.

Another option is Bonjour. It's an Apple technology, but there are implementations for Linux (Avahi) and Windows (Bonjour for Windows). Bonjour let's you access other computers using the syntax:


I went with this solution, because I don't have a DD-WRT compatible router, or an always-on server to run DNS. Also, once its set up, you don't have to worry about whether an IP changes, like with a hosts file.

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.