Linux – How to get Windows to see Linux host names and vice versa

dnslinuxnetworkingwindows

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?

Best Answer

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.

Related Question