From nobody@FreeBSD.org  Mon Feb 21 13:27:37 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21])
	by hub.freebsd.org (Postfix) with ESMTP id DA1B537B952
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Feb 2000 13:27:36 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.9.3/8.9.2) id NAA23443;
	Mon, 21 Feb 2000 13:27:36 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Message-Id: <200002212127.NAA23443@freefall.freebsd.org>
Date: Mon, 21 Feb 2000 13:27:36 -0800 (PST)
From: borjamar@sarenet.es
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: "domain" directive in /etc/resolv.conf not consistent when using IPv6 and IPv4
X-Send-Pr-Version: www-1.0

>Number:         16892
>Category:       bin
>Synopsis:       "domain" directive in /etc/resolv.conf not consistent when using IPv6 and IPv4
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 21 13:30:01 PST 2000
>Closed-Date:    Tue Jul 18 00:42:37 PDT 2000
>Last-Modified:  Tue Jul 18 01:00:01 PDT 2000
>Originator:     Borja Marcos
>Release:        4.0-CURRENT
>Organization:
>Environment:
FreeBSD pepe.arnor.es 4.0-CURRENT FreeBSD 4.0-CURRENT #1: Sun Feb 20 13:02:36 GMT 2000     root@pepe.arnor.es:/usr/src/sys/compile/NENUIAL  i386

>Description:
A machine with both IPv6 and IPv4 and an /etc/resolv.conf file with the
"domain" or "search" options searches addresses in wrong order (IMHO)
When resolving a domain-less name, the resolver does the queries in the 
following order: (for example, this is the "arnor.es" domain and I'm
trying to contact "nenuial")
1 - Query AAAA nenuial.arnor.es
2 - Query AAAA nenuial
3 - Query A nenuial.arnor.es
4 - Query A neuial

I think the order should be 1,3,2,4. The "domain" and "search" options in
/etc/resolv.conf specify that the domain suffix should be added to
domain-less names, and the current behavior violates this principle. Only
IPv6 queries work in this way.

In a network with demand-dialing to Internet, this causes the 
router to dial, as the suffix-less name has to be resolver outside
the local network.

>How-To-Repeat:
Enable both IPv4 and IPv6, and use a /etc/resolv.conf file with
a "domain" or "search" keyword.
Try to telnet, ping, ftp or whatever, one of the machines, using the
domain-less name.
>Fix:
Changing the order in which the queries are done.


>Release-Note:
>Audit-Trail:

From: Borja Marcos <borjamar@sarenet.es>
To: freebsd-gnats-submit@FreeBSD.org, borjamar@sarenet.es
Cc:  
Subject: Re: bin/16892: "domain" directive in /etc/resolv.conf not consistent 
 when using IPv6 and IPv4
Date: Tue, 22 Feb 2000 13:25:02 +0100

 	I have been looking at the code. The IPv6 resolution has
 been added to /sys/lib/libc/net/gethostnamadr.c, modifying the
 gethostbyname() function. With IPv6 enabled, it queries first for
 a IPv6 address and, if this fails, for an IPv4 address.
 
 	The queries for IPv6 and IPv4 should be done in the DNS
 resolver routines, at a lower level, preserving the "search" and
 "domain" semantics.
 
 	A candidate would be res_search()? 
 -- 
 ***********************************************************************
 Borja Marcos                    * Internet: borjam@we.lc.ehu.es
 Alangoeta, 11 1 izq             *           borjamar@sarenet.es
 48990 - Algorta (Vizcaya)       *           borjam@uninet.edu
 SPAIN                           *           borjam@well.com
 ***********************************************************************
 --- FreeBSD, turning PCs into workstations
 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Tue Jul 18 00:42:37 PDT 2000 
State-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=16892 

From: Hajimu UMEMOTO <ume@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc: borjamar@sarenet.es, freebsd-bugs@FreeBSD.org
Subject: Re: bin/16892: "domain" directive in /etc/resolv.conf not
 consistent when using IPv6 and IPv4
Date: Tue, 18 Jul 2000 16:53:25 +0900

 >>>>> On Tue, 18 Jul 2000 00:44:42 -0700 (PDT)
 >>>>> ume@FreeBSD.org said:
 
 ume> Synopsis: "domain" directive in /etc/resolv.conf not consistent when using IPv6 and IPv4
 
 ume> State-Changed-From-To: open->closed
 ume> State-Changed-By: ume
 ume> State-Changed-When: Tue Jul 18 00:42:37 PDT 2000
 ume> State-Changed-Why: 
 
 Oops, I missed to add State-Changed-Why.
 Recent changes to getaddrinfo.c fixed the DNS search order.
 
 --
 Hajimu UMEMOTO @ Business Solution System Development Div., Hitachi Ltd.
 E-Mail: ume@bisd.hitachi.co.jp ume@mahoroba.org  ume@FreeBSD.org
 URL: http://www.imasy.org/~ume/
 
>Unformatted:
