Google Compute Engine – DNS Forwarder / Nameserver

google-cloud-platformgoogle-compute-engineubuntu-14.04

I am trying to setup a Ubuntu 14.04 instance in GCE and in doing so I need to setup the server to resolve some dns queries for an internal custom domain name that sits in our internal network on the other end of a VPN.

Every attempt to assign a name server gets overwritten by the GCE DHCP settings.

I have tried to assign a name-server to /etc/network/interfaces.d/eth0.conf and in doing so assigns the nameserver in the resolv.conf file, but it still does not resolve the internal domain correctly, always trying to resolve against Google's servers.
I also attempted to add a name server and domain name to the dhclient.conf file, but it doesn't seem to make any difference to changing these values in the local dhcp file.

Is there a way to go about setting an additional DNS forwarder in an ubuntu instance?

Best Answer

The behavior and the workaround are documented here, ¨resolv.conf¨ gets indeed reverted by DHCP. The workaround is to modify the DHCP client policy to pre-append the IPs (/etc/dhcp/dhclient.conf).