Hostname configuration on DHCP/DNS server: /etc/hosts vs. /etc/hostname

Tom H tomh0665 at gmail.com
Sun Mar 27 13:44:54 UTC 2011


On Sun, Mar 27, 2011 at 8:56 AM, Niki Kovacs <contact at kikinovak.net> wrote:
>
> I have a DHCP/DNS server (Ubuntu 10.04) running on my local network. The
> domain name is the dummy "presbytere.montpezat" for all the local machines.
> Of course the server has a static network configuration in
> /etc/network/interfaces.
>
> Here's how /etc/hosts is configured:
>
> 127.0.0.1 localhost.localdomain localhost
> 192.168.1.2 proliant.presbytere.montpezat proliant
>
> Now I wonder what I should put in /etc/hostname. I think it should only be
> this:
>
> proliant
>
> But now I wonder if I should put the FQDN in it, like this :
>
> proliant.presbytere.montpezat
>
> If I remember correctly, that's how my Red Hat servers were configured.
> Anybody knows the "right" (or at least the orthodox) way to do this?

I don't know what the canonical (not Canonical!) way of doing this is
because the last time that I checked even the Debian developers were
arguing over this. It's something of a religious debate.

You can put either. The only functional difference that I know of is
that the output of "hostname" will differ ("hostname -s" and hostname
-f" will be the same).




More information about the ubuntu-users mailing list