HOSTNAME from DNS name server

Pieter Donche Pieter.Donche at
Mon Jun 29 13:04:49 UTC 2009

In Ubuntu, the file /etc/hostname contains the name given during
initial installation (Step 5: What is the name of this computer?),
  e.g. pc-ubu
It is also the contents of the Environment variable HOSTNAME
and when starting a terminal window, it appears in the prompt
  e.g. adrian at pc-ubu:~$

My PC gets its TCP/IP parameters from a DHCP server. Among these
parameters is a DNS nameserver (and two backup DNS nameservers).
In the DNS  the hostname for the IP address of my PC is different
  e.g. pccl14

I would like to always have this hostname used.
How can I make Ubuntu use the name from the DNS name server
in the env.var. HOSTNAME  and nou use /etc/hostname at all ?

This is NOT a solution for me: writing pccl14 in /etc/hostname
and /etc/hosts because this PC is a model PC for cloning to many
other PCs, I don't want the cloned PCs to have all of them the
same name, but I want them all different (their DNS name).

More information about the ubuntu-users mailing list