Subject: bin/24714: Bug report
To: None <gnats-bugs@gnats.netbsd.org>
From: Panu Rissanen <panu.rissanen@kv9.net>
List: netbsd-bugs
Date: 03/09/2004 12:09:39
>Number:         24714
>Category:       bin
>Synopsis:       Ping tries to resolve host address by the default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 09 12:10:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Charlie Root
>Release:        NetBSD 1.6.2
>Organization:
	Panu Rissanen 
>Environment:
System: NetBSD foobar 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004 autobuild@tgm.netbsd.org:/autobuild/netbsd-1-6-PATCH002/i386/OBJ/autobuild/netbsd-1-6-PATCH002/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Ping tries to resolve target host name before sending out any icmp packets
even if the target is an IP-address.

In a normal situation, where DNS is working, this is causing no problems
at all. However, in case of partial network failure, when the DNS server
is unreachable, failure to execute ping command can cause strage
results (especially to the people who know Unix well but have little
experience with NetBSD). Because ping doesn't send any packets before DNS    
timeout, the host doesn't ask for ARP. People, like me, break off the ping 
after waiting for 10 secs and start up to look for network problems 
with arp -n, which in this case, naturally, doesn't show anything.

It is possible to ping also when DNS server is unreachable by using -n
flag (or simply wait for the DNS timeout). Let's look at what the manual
says about the ping parameters

     -n      Numeric output only.  No attempt will be made to look up symbolic
             names for host addresses.

".. for the host addresses" refers to the hosts which are replying to your
ping packets. If fact, preventing DNS lookup at the startup is undocumented
feature.

You may think this a feature, not a bug. But in case of feature, why is this
implemented only in the NetBSD? At least FreeBSD, Solaris, Linux and
even Windows are always trying to ping without reverse lookup, unless
you order host to do it.

>How-To-Repeat:
	Make a false entry to your resolv.conf for the nameserver and try
	to ping one of your hosts in your local network.
>Fix:
	Update to the ping.c
>Release-Note:
>Audit-Trail:
>Unformatted: