Re: [Hampshire] What do *you* put in /etc/hostname on Debian…

Top Page

Reply to this message
Author: Adrian Bridgett
Date:  
To: Hampshire LUG Discussion List
CC: surrey
Subject: Re: [Hampshire] What do *you* put in /etc/hostname on Debian?
On Thu, Apr 15, 2010 at 05:07:15 +0000 (+0000), Andy Smith wrote:
> For those of you adminstering Debian or Ubuntu, given a FQDN of
> "foo.example.com", what would *you* put in the /etc/hostname,
> /etc/hosts and /etc/mailname files?


/etc/hosts
127.0.0.1       localhost
127.0.1.1       foo.example.com foo


/etc/mailname:
foo.example.com

/etc/hostname:
foo

I've seen some apps make bad assumptions (e.g. they bind to the IP in
question). My personal solution (given that shooting the developers
maybe out of the question) is to use service names (which is always a
good idea).

NB: hostname has _nothing_ to do with IP or DNS. It's a (hopefully
unique) hostname, that's it.

> If it came to the desired FQDN being "example.com" though, then it
> would be more like:


I think that's a bad idea and asking for trouble later. I'd always
have a proper name - foo.example.com. If you want it to act as a
web/email server for example.com, great - do that in the
web/email config.

Adrian
--
bitcube.co.uk - Expert Linux infrastructure consultancy
Puppet, Debian, Red Hat, Ubuntu, CentOS