I am deploying Ubuntu 12.04 VM's from a template using vCenter 5.5. When I try to add nameservers using a customization specification they are added to the resolv.conf file. The VM will not use these nameservers, and will be unable to resolve names. I can, however, manually specify the same nameservers using the dig command and successfully resolve names. If I manually add nameservers to /etc/network/interfaces the VM will use them and becomes able to resolve names. What is the cause of this behavior?
If you have
resolvconf
installed on your system it will manage/etc/resolv.conf
for you. Anything you manually put intoresolv.conf
will be replaced eventually, which is why name servers need to be defined in/etc/network/interfaces
or theinterfaces.d
directory.If you want to control
resolv.conf
manually remove theresolvconf
package.Note: It is typically best to configure and manage your system based on the best practices defined by your distribution or vendor. If you remove
resolvconf
make sure you aren't breaking anything else that requires it.