Subject: Re: IPv6/v4 host to IPv4 host strangeness
To: None <apriebe@aip.de>
From: None <itojun@iijlab.net>
List: current-users
Date: 09/02/1999 14:24:54
>phil (IPv4/v6 host) has -current from the beginning of July (3rd ???) - just
>before the ELF change (I was afraid to break my running machine - but
>maybe indeed it is time now for the change ...).
>
>phil:
>/etc/resolv.conf
>search apc.aip.de ipv6.apc.aip.de
>nameserver 141.33.241.1
>lookup file bind
>
>/etc/nssitch.conf
>default, except the hosts: line
>hosts:          files dns
>
>/etc/hosts
>127.0.0.1               localhost
>141.33.241.1    spade
>141.33.241.4    phil phil.apc.aip.de
>3ffe:2a00:100:3022:2a0:24ff:fe53:5890   phil.ipv6.apc.aip.de
>(plus some other entries related to other hosts)
>
>BTW If I add spade.apc.aip.de to the 141.33.241.1 line, the
>telnet spade.apc.aip.de "spade.apc.aip.de: non-recoverable failure
>in name resolution" gose away and behaves exactly like telnet spade.

	I believe the "use of bogus IPv6 address" part of problem is already
	solved.  Please update to more recent code, especially src/lib/libc/net.

	Search order is still very tricky part.  telnet uses getaddrinfo(3),
	and getaddrinfo(3) calls gethostbyname2(3) twice to resolve
	"phil" to IPv6 and IPv4 addresses.  As a result, search order
	will be
		IPv6 phil.apc.aip.de	-> not exist
		IPv6 phil.ipv6.apc.aip.de -> exists
		IPv4 phil.apc.aip.de -> exists
		IPv4 phil.ipv6.apc.aip.de -> not exist
	so, IPv6 wins over IPv4.  Actually, getaddrinfo(3) should use
	getipnodebyname(3) as its underlying function, however, it is not
	merged for avoiding too many non-BIND changes in resolver code.
	This was discussed in July 99 in tech-net or somewhere, I believe.

itojun