[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#247734: hostname on multiple lines in /etc/hosts



Hi,

On Mon, Jun 07, 2004 at 05:22:15PM +0200, Thomas Hood wrote:
> > 127.0.0.1	localhost	pingo
> > 10.10.0.17	pingo.miss-knife.net	pingo
> 
> On rereading the original message I realize that I overlooked the most
> important fact.  The hostname, 'pingo', appears on two lines in the
> /etc/hosts file.  The presence of 'pingo' on the 127.0.0.1 line causes
> 'localhost' to be pingo's canonical hostname whereas (I take it) the
> user wants 'pingo.miss-knife.net' to be pingo's canonical hostname.
> Pierre Machard: Have I got that right?

Yes, you did.

> I can think of a couple of different ways of solving this problem.
> The first is to eliminate 'pingo' from the 127.0.0.1 line if and
> only if 'pingo' appears on some other line.

That's what I commited to the subversion tree, but apparently Joshua
did not integrate this change. 

> A second approach to solving the problem is to have two separate
> 127.0.0.1 lines, one of them at the very end.  It acts as a default
> canonical hostname specifier for the machine.  Experiment shows that
> this gives the Right behavior; however I am not sure that it is legal
> for one IP address to appear on more than one line in /etc/hosts.

It's very difficult to find info about that. 

> # /etc/init.d/dnsmasq restart
> # cat /etc/hosts
> 127.0.0.1       localhost
> 10.10.0.17      pingo.miss-knife.net    pingo
> 127.0.0.1       pingo
> # hostname
> pingo
> # hostname --fqdn
> pingo.miss-knife.net
> # # Note that dnsmasq (which looks in /etc/hosts) is running
> # host pingo
> pingo has address 127.0.0.1
> pingo has address 10.10.0.17
> # host 127.0.0.1
> 1.0.0.127.in-addr.arpa domain name pointer localhost.
> 1.0.0.127.in-addr.arpa domain name pointer pingo.
> # vi /etc/hosts
> # /etc/init.d/dnsmasq restart
> # cat /etc/hosts
> 127.0.0.1       localhost
> 127.0.0.1       pingo
> # hostname --fqdn
> pingo
> # host pingo
> pingo has address 127.0.0.1
> # host 127.0.0.1
> 1.0.0.127.in-addr.arpa domain name pointer localhost.
> 1.0.0.127.in-addr.arpa domain name pointer pingo. 

Somehow interesting, maybe we should ask to d-devel@l.d.o ?

Cheers,
-- 
                                Pierre Machard
<pmachard@debian.org>                                 http://debian.org
GPG: 1024D/23706F87 : B906 A53F 84E0 49B6 6CF7 82C2 B3A0 2D66 2370 6F87

Attachment: signature.asc
Description: Digital signature


Reply to: