Overriding Google Compute Engine hostname from getting reset

On my last post, I explained how I am experimenting with Google Compute Engine (GCE) to host my backup DNS service and my post about configuring mailjet as an exim mail relay.

I have run into a few issues on Google Compute Engine, it looks like every time the instance gets a DHCP offer the hostname of the machine will get reset to the internal hostname, overriding whatever setting you may have set… this is bad news for a server that needs to respond to DNS settings.

After a few hours of digging and testing out different approaches, including trying to setup a DHCP hook to run the “hostname” linux command I came across documentation from Google talking about “custom metadata”.

2 responses to “Overriding Google Compute Engine hostname from getting reset

  1. Thanks , it worked for me for changing hostname 🙂
    but i still having problems to run the dns server

  2. Very Happy with your post it worked for me!!!!
    Please edit the (run “crontab -e”) to (run “sudo env EDITOR=nano crontab -e”) so that you can edit the crontab!

    Thank you very much, you saved my day!

Leave a Reply

Your email address will not be published. Required fields are marked *