When nslookup works but you can’t ping it, NetBIOS may be missing

I have a custom DNS Server (running Linux) and I also have a server running Linux ("MyServer"). The DNS Server has an entry in /etc/hosts for MyServer.

On my Windows machines, I can nslookup MyServer and get the IP back, but when I try to access the machine through ping or any of the services it offers, the name doesn't resolve. Access via the IP Address works fine though.

What's interesting is that if I add a dot at the end (ping MyServer.) then it suddenly works. What's happening?!

What's happening is that Windows doesn't use DNS but NetBIOS for simple name resolution. nslookup talks to the DNS Server, but anything else doesn't use DNS.

The trick was to install Samba on MyServer, because it includes a NetBIOS Server (nmbd). On Ubuntu 16.04, just running sudo apt-get install Samba installs and auto-starts the service, and from that moment on my Windows machines could access it without issue.

There are ways to not use NetBIOS, but I didn't want to make changes on every Windows client (since I'm using a Domain), so this was the simplest solution I could find. I still needed entries in my DNS Server so that Mac OS X can resolve it.