Are you having hostname resolution issues in the Public Cloud? Then you’ve come to the right place!

Hostname resolution will fail on Linux based servers unless you update the the DHCP options manually.

Default config;

root@myhost:/home/myusername cat /etc/resolv.conf
nameserver x.x.x.x
nameserver y.y.y.y

To update this run the following command;

echo "supersede domain-name \"maindomain.local  subdomain.maindomain.local dmz.local\";" >> /etc/dhcp/dhclient.conf

Then refresh your DNS config;

dhclient -v

Verify resolv.conf has updated;

cat /etc/resolv.conf