which is better/more correct for /etc/hosts

C M Reinehr cmr at amsent.com
Wed Dec 12 11:18:18 PST 2007


Doug,

On Wednesday 12 December 2007 11:55, Douglas J Hunley wrote:
> is this better:
> 192.168.10.1	servera,serverb,serverc
> or this:
> 192.168.10.1	servera
> 192.168.10.1	serverb
> 192.168.10.1	serverc
>
> and why is it better?

This probably is wasting bandwidth as I'm sure you've already read the manual 
and are looking for something deeper, but it states clearly:

> This manual page describes the format of the /etc/hosts file. This file is
> a simple text file that associates IP addresses with hostnames, one line
> per IP address. For each host a single line should be present with the
> following information:
>
>
>  IP_address canonical_hostname [aliases...]

I interpret this to mean that each line should reference a unique ip address 
rather than duplicate the ip addresses of previous lines. My fear is that 
placing each alias on a separate line would result either in the second & 
third alias being ignored, or in the first and second being 
ignored/overwritten by the last entry.

That being said, I'm basing this solely on the manual rather than upon 
practical experience, which is risky! ;-)

Cheers!

cmr
-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list