Accessing a VM (ESXi) by its hostname doesn't work [closed]
Question
I've set up a VM running Debian Squeeze within VMware ESXi 5.0. It has a running webserver and some other stuff. My goal is to access this machine by its hostname from other computers in my local network. This isn't working, currently I can only access this VM with its IP address.
In my network is a Windows Server 2003 running (as a domain controller with an AD), which is also a DHCP server. My VM correctly gets an IP address from the subnet 192.168.115.0/24. It can also ping and access other machines from the network by their name after I installed winbind. But the other way around doesn't work, other machines can't find the hostname of this VM.
I have captured the process when my Win7 machine tries to ping this VM by its hostname. Wireshark shows me the following (.100 is the server, .103 is my local machine):
43 2.700104 192.168.115.103 192.168.115.100 NBNS 92 Name query NB INFORMATIX2<00>
44 2.700487 192.168.115.100 192.168.115.103 NBNS 98 Name query response, Requested name does not exist
45 2.720377 192.168.115.103 192.168.115.255 NBNS 92 Name query NB INFORMATIX2<00>
So I guess my server doesn't know the VM, despite having delivered an IP address to it.
What is wrong here?
Solution
Ok, I found the problem. The cause was that my Linux machine hasn't enabled dynamic DNS updates (see also manpage of dhclient.conf, section 'DYNAMIC DNS'). This thread had the right hint for me - I have to edit my dhclient.conf and add send host-name "debian-vm"; to it. Despite what is written at the manpage, the hostname is sufficient - I don't need the fqdn.
Now it works - I can access my VM from every other machine in my network. To verify this, I looked at DHCP server settings from the Win2k3 server and checked the leases. Now the name of my VM is shown in the column 'name' - it was empty before the change.
I have to add another piece of information: If you setup the DHCP server of Win2k3 to deliver a specific IP to the MAC address of your VM, it is necessary to activate "updates of DNS-A and -PTR entries for clients which do not request updates" in the properties of your DNS reservation.