Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Feb 2000 13:24:51 +0100 (MET)
From:      Borja Marcos <borjam@we.lc.ehu.es>
To:        hackers@freebsd.org
Subject:   IPv6, IPv4 and /etc/resolv.conf problems
Message-ID:  <200002221224.NAA03116@sol.we.lc.ehu.es>

next in thread | raw e-mail | index | archive | help
	Hello,

	I'm testing 4.0-current and have just found a problem ith
the resolver. It seems this problem is lurking many releases ago,
but in only appears when using IPv6 and IPv4.

	If you enable both, and use the "domain" or "search" keyword
in /etc/resolv.conf, it doesn't work well.

	If you do a gethostbyname() with a domainless name, the queries
it does are:

	1 - AAAA host.domain (following the "domain" or "search" directive)
	2 - AAAA host
	3 - A host.domain
	4 - A host


	This is caused by the way the IPv6 resolution has been added in 
/sys/lib/libc/net/gethostnamaddr.c in gethostbyname().

	It simply queries first for IPv6 info, and if there is no answer, it
queries for IPv4 info.

	The decision to query for IPv6 or IPv4 should be more "deeply
buried", especially in the case of DNS queries. Otherwise the system, can be
quite uncomfortable to use.

	I discovered this by accident; after installing a test 4.0-CURRENT
system in my home network, I did a "telnet hostname" and it didn't connect
for many seconds, the telnet seemed to be waiting for a name resolution 
to finish. It worked as fast as usual only when I was connected to Internet.
(I have a local DNS server in the network). I had enabled IPv6 in the 
CURRENT machine to be able to start trying IPv6. While I was connected
to Internet, it worked almost immediately because sending a query
for "hostname" (without domains) to the Internet DNS servers returned 
(obviously) and error, and then gethostbyname() proceeded to ask for the 
IPv4 records.

	I have sumbitted it as a bug to GNATS, with the id bin/16892.


	Borja.

	



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002221224.NAA03116>