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:
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
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
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
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.
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