Bug 68212

Summary: ping name resolving
Product: [Retired] Red Hat Linux Reporter: Phil Quiney <philip.quiney>
Component: iputilsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-05-15 14:45:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Phil Quiney 2002-07-08 07:21:44 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530

Description of problem:
When using ping to a host name, it performs a DNS lookup on the hostname before
sending each ping packet (that is once per second). This is 'new' (& unwanted)
behaviour AFAIK.Pinging to an IP address works as expected.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Start tcpdump or ethereal monitoring network/hosts involved
2. ping somehostname # Note hostname not in /etc/hosts
3. Observe DNS lookups on link at same rate as Ping packets for the host being
ping'ed.
4. Say to yourself "This is a bug"
	

Additional info:

Comment 1 Phil Knirsch 2002-07-17 12:28:15 UTC
Ahhh! Thats a good info! I've had several other reports with timeouts and
package loss when using hostnames resolved via DNS instead of in /etc/hosts or
with direct IPs with ping. That might be the reason why.

Thanks for spotting that, will fix.

Read ya, Phil

Comment 2 Phil Knirsch 2003-05-15 08:53:59 UTC
OK, after checking the latest versions the problem seems to be that ping uses
gethostbyaddr() for every package. With the -n option you can prevent that.

I have tested with various sites and using an IP or a name on the commandline
and the output always looked the same, so i honestly wonder where the difference
really is. :-)

So the simple solution for now is to use the -n option in your scripts. I'll
look into reverting the behaviour to the old style (as i also think that a DNS
call for every single package is a little bit of an overkill).

Read ya, Phil

Comment 3 Phil Quiney 2003-05-15 09:09:36 UTC
Hi

Using'gethostbyname' for every ping packet is just *WRONG*. Consider what would
happen trying to do a 'flood' ping (ping -f) to a named host; you flood your
network with both DNS lookups as well as the ping packets.

This is definitely not expected behaviour.

(At least this version of ping dosen't complain about 'time of day goes back...'
even between NTP synced machines, like on RH7.2) ;-)

Regards

Phil Q

Comment 4 Phil Knirsch 2003-05-15 10:11:22 UTC
Urgs, yes, true. I just checked and got a factor of 3 in running time in our
local network! Thats really bad. Will fix. :-)

Read ya, Phil

PS: With nscd running on the local machine things will work nicely again, too,
as the nscd will cache that DNS query.

Comment 5 Phil Knirsch 2003-05-15 14:45:58 UTC
OK, just made a patch. It now caches internally the last printed address. Works
fine for me now and will be in the next rawhide release (iputils-20020927-4).

Read ya, Phil