Motivation

I have to manage a lot of virtual machines that I create by copying a template (VmWare image).

Problem

Now I have the problem that in the template the file /etc/hostname contains a given name that I want to change for each copy of the template.

Facts

The network interface is configured by DHCP. DNS entries exist. The system is a Ubuntu 9.10 server.

Question

I wonder if I can configure the template so that on startup it sets its hostname according to its DNS name.

I could create an init script that parses the IP address, makes a DNS lookup and sets the hostname accordingly.

But is there an easier way?

link|improve this question

feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.