Bug 25749

Summary: gethostbyaddr only seems to look at /etc/hosts and not bind as of kernel FreeBSD 4.3-BETA #6
Product: Base System Reporter: duco <duco>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description dima 2001-02-26 04:25:31 UTC
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?
Comment 1 duco 2001-03-12 20:40:01 UTC
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

Fix: 

add the entries to /etc/hosts
How-To-Repeat: remove the entries from /etc/hosts
Comment 2 duco 2001-03-12 23:00:55 UTC
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
Comment 3 Kris Kennaway freebsd_committer freebsd_triage 2001-03-13 02:16:14 UTC
State Changed
From-To: open->closed

Submitter reports problem resolved