On 22/05/14 13:50, John Hodrien wrote:
On Thu, 22 May 2014, Rowland Penny wrote:
> Not on Ubuntu it isn't ;-)
I'd argue that Ubuntu just has incorrect behaviour then.
If you look at man hosts on an ubuntu machine (13.10), you'll see how
they
describe it, and the example they provide. The format described is:
IP_address canonical_hostname [aliases...]
The example is:
127.0.0.1 localhost
192.168.1.10
foo.mydomain.org foo
192.168.1.13
bar.mydomain.org bar
That's the correct format, whether or not Ubuntu applies it.
Thats all very well for a machine with a fixed ip but what about DHCP ?
That said, the only machine I have with ubuntu defined a hosts file with:
127.0.1.1 short-ubuntu-13.10 short-ubuntu-13
That, in a slightly unpleasant way, follows the way I'd do it.
jh
Yes, that is what Ubuntu does out of the box, but without the domain
name in /etc/hosts, hostname & hostname -f just returns the short-hostname.
Rowland