From nobody@FreeBSD.org  Mon Mar 12 12:35:29 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 7C58937B718
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 12 Mar 2001 12:35:28 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f2CKZSv95732;
	Mon, 12 Mar 2001 12:35:28 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200103122035.f2CKZSv95732@freefall.freebsd.org>
Date: Mon, 12 Mar 2001 12:35:28 -0800 (PST)
From: duco@jaspars.net
To: freebsd-gnats-submit@FreeBSD.org
Subject: gethostbyaddr only seems to look at /etc/hosts and not bind as of kernel FreeBSD 4.3-BETA #6
X-Send-Pr-Version: www-1.0

>Number:         25749
>Category:       kern
>Synopsis:       gethostbyaddr only seems to look at /etc/hosts and not bind as of kernel FreeBSD 4.3-BETA #6
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 12 12:40:01 PST 2001
>Closed-Date:    Mon Mar 12 18:16:14 PST 2001
>Last-Modified:  Mon Mar 12 18:30:06 PST 2001
>Originator:     Duco Jaspars
>Release:        4.2 STABLE
>Organization:
private
>Environment:
FreeBSD dino 4.3-BETA FreeBSD 4.3-BETA #6: Sun Mar 11 20:04:44 CET 
>Description:
Yesterday I did a cvsup for 4.2 STABLE and build a new kernel.

After a reboot of my system which always worked fine up to yesterday, to load the new kernel, I noticed 2 problems.
First problem was that sendmail kept complaining about two virtual interfaces in my box:

Mar 12 00:35:20 dino sendmail[43139]: gethostbyaddr(212.153.153.10) failed: 2 
Mar 12 00:36:40 dino sendmail[43139]: gethostbyaddr(212.153.153.11) failed: 2 
Mar 12 00:37:20 dino sendmail[43427]: gethostbyaddr(212.153.153.10) failed: 2 
Mar 12 00:38:40 dino sendmail[43427]: gethostbyaddr(212.153.153.11) failed: 2 
Mar 12 00:39:21 dino sendmail[43998]: gethostbyaddr(212.153.153.10) failed: 2 
Mar 12 00:40:41 dino sendmail[43998]: gethostbyaddr(212.153.153.11) failed: 2 

every time sendmail was invoked, it took ages to send or receive mail since it seemd to be waiting for an answer from gethostbyaddr for the two aditional interface ip numbers.

Both IP numbers have forward and reversed mapping in DNS, but where not in /etc/hosts, but tools like host on the box produced answers

The second problem was when I tried to start and X session from an other system on this box trough XDMCP, which used to work, nothing happened.

When I added all local IP numbers for this box to /etc/hosts, both problems dissapeared.

To me it seems like there is something broken in the gethostbyaddr syscall so it only looks at the hostsfile and does not fall back to BIND if the hosts are not in /etc/hosts. First I thought this was a security enhancement, but I could not find any notification about it in the documentation or on the FreeBSD website, so now I think it is a bug

Tools like host, dig and nslookup answered on a reversed lookup for both IP numbers, but sendmail and probably xdm or syslog refused to querry bind. 


my /etc/host.conf file contains:

# $FreeBSD: src/etc/host.conf,v 1.6 1999/08/27 23:23:41 peter Exp $
# First try the /etc/hosts file
hosts
# Now try the nameserver next.
bind


/etc/resolv.conf contains:

nameserver      127.0.0.1
nameserver      212.153.153.1

>How-To-Repeat:
remove the entries from /etc/hosts
>Fix:
add the entries to /etc/hosts
>Release-Note:
>Audit-Trail:

From: Duco Jaspars <duco@jaspars.net>
To: freebsd-gnats-submit@FreeBSD.org, duco@jaspars.net
Cc:  
Subject: Re: kern/25749: gethostbyaddr only seems to look at /etc/hosts
  and not bind as of kernel FreeBSD 4.3-BETA #6
Date: Tue, 13 Mar 2001 00:00:55 +0100

 Hi
 
 just compiled a new kernel, 4.3 BETA #8 apparently, and this seems to have 
 fixed my resolving issue.
 
 Can you please confirm this issue is fixed in the change from #6 to #8?
 
 
 Regards
 
 Duco 
 
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Mon Mar 12 18:16:14 PST 2001 
State-Changed-Why:  
Submitter reports problem resolved 

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

From: Dima Dorfman <dima@unixfreak.org>
To: Duco Jaspars <duco@jaspars.net>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/25749: gethostbyaddr only seems to look at /etc/hosts and not bind as of kernel FreeBSD 4.3-BETA #6 
Date: Sun, 25 Feb 2001 20:25:31 -0800

 Duco Jaspars <duco@jaspars.net> writes:
 >  just compiled a new kernel, 4.3 BETA #8 apparently, and this seems to have 
 >  fixed my resolving issue.
 >  
 >  Can you please confirm this issue is fixed in the change from #6 to #8?
 
 That's the number of times you compiled your kernel.  FreeBSD doesn't
 set it.  It is reset when you do a "make clean" in the kernel build
 directory.  I think that you just did something wrong with your first
 update, and redoing whatever it was correctly the second time fixed
 it.  Could that be it?
>Unformatted:
