Windows DNS sometimes can't pick up my VM's hostname

RE: unresolved hostname / host not found / host unknown

The VM is VirtualBox running Ubuntu under Win8, using the bridged networks.

It almost always able to register itself to my company's Windows DNS server, so that I can ping myvm1 from my DOS, or dig myvm1.mycompany.com from within the Ubuntu. But there ARE times that I can't do either of them. I'll get host unknown error. The Ubuntu VM is always the same, so I think it is the Windows DNS server that is causing the problem.

Searching for the solution myself, I only to find an unanswered question, which has the exact symptom as mine -- what are some possible reasons why my company's DNS server sometimes fails to resolve the host name of some of my VM's?

Any ideas, for solution or to troubleshoot it?

PS. Adding Ubuntu/Linux to the tags -- anyway to know which DNS server the Ubuntu VM register itself to? How can I force re-register my Ubuntu's dhcp/dns?


Solution 1:

This is one of those questions that can go sprawling in all sorts of directions as there are many ways you could proceed.

First of all, name resolution in windows uses more than DNS. The command to use to see if DNS can resolve a name is nslookup, so you would use nslookup myvm1.mycompany.com to see if it is in DNS for that domain.

Secondly doing ping myvm1 from a machine will use more than just DNS for name resolution, it may be using NetBIOS, WINS, or some auto-discover query like multicast DNS (mDNS) or DNS Self Discovery (DNS-SD), Ubuntu implements these through the avahi daemon. Even if it is doing a DNS lookup it may be using more than just the mycompany.com DNS search domain.

Given that it works most of the time, I'm guessing that the name myvm1 is being used with avahi with either mDNS or DNS-SD that the windows name resolver queries when you run ping. These zeroconf name resolution protocols do not use an actual DNS server and so do not need to authenticate themselves to an AD integrated DNS server. From my experience the zeroconf mDNS/DNS-SD protocols are not 100% reliable, which adds to my belief that these are being used in your case as it matches your situation.

You could go in multiple directions from here

  • ensure avahi is working properly
  • If the mycompany.com is a typical windows domain run by Active Directory it will require the machine to be part of the domain for it to push automatic DNS updates to the server. You could make a manual DNS entry into the mycompany.com domain and either
    • make the ubuntu vm a static IP with either a fixed IP in its local config or a DHCP reservation. These are my 1st and 2nd preferences for a solution.
    • allow insecure updates for the name myvm1.mycompany.com
  • make the Ubuntu VM part of the AD domain so it can do authenticated automatic DNS updates. This may require samba version 4 or above.

As a couple of first steps I would check

  • Check the DNS search domain order on your windows machine to see if it is even looking at the domain mycompany.com when you type in just a host name.
  • On the Ubuntu VM ensure that you have set the full qualified domain name for the machine as described on this how to.