Use hostname or in /etc/hosts??

Use hostname or in /etc/hosts??

Post by Mark Aitchison - Physics and Astronomy Computologi » Thu, 17 Sep 1998 04:00:00

Should the /etc/hosts file list hostnames in fully-qualified domain name format
or just the bare hostname?  Linux setups seem to push the fqdn option as the
standard.  Having a mixture interfers with all sorts of things, and I'd
like to standardise.  I can see some security advantage in using the domain
names in exports files, etc, when nis or dns is used, but why /etc/hosts?

Who decides on such conventions?

Mark Aitchison.


1. DHCP, /etc/hosts/, Gnome and

*Using RH 7.2, Ximian Gnome, 2.4.17 kernel*
I recently switched from ADSL to cable which assigns its IP via DHCP.

Before switching I had a static IP which I used to set my host and domain
name to (I own the in question though the
web server and such are located out of country).

I can now set the hostname via the dhcp_ to hostname tag in my
/etc/sysconfig/network. However, I had to remove the static ip from my
hosts file and now whenever I startx into Gnome I get a "bad hostname"
starting up.

Does anyone know how to correct this for a DHCP connection? Do I jsut put
a false entry into the /etc/hosts file for the hostname I want?

/etc/hosts/ is       localhost.localdomain
from before.

Ideally it would be great if I could get the IP from dhcp on startup and
then update my own dns so that everthing I want points to my laptop here.

Anyhow, curious now,so any help greatly appreciated.

2. Bind YP server on other subnet???

3. Q: Host name causes delivery problems (

4. TIS fwtk vs other proxy-server

5. /etc/mnttab and hostname/domain name

6. Linux - Ethernet - HP-UX => does not work

7. Using both /etc/hosts and domain name server to get host addrs

8. Sparcstation 1 and installing solaris

9. Rewrite hostname to hostname.domain.tld

10. hostname and domain name

11. [domain name with a Static hostname but Dynamic IP]

12. Domain name, hostname

13. Domain name as hostname as well?