New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Strange ping behavior
Microlinux
Member
This has me scratching my head. I discovered it while testing a ping program with a list of random domains I found. It happens on multiple systems.
If a run ping -i.5 -c5 -W1 aardvark.org
(send 5 pings at .5 sec intervals and timeout after 1 second), it takes a minute to complete. It takes forever for the first response to be printed, then there are long intervals between the following responses . . . but RTT looks normal.
time ping -i.5 -c5 -W1 aardvark.org
[...]
--- aardvark.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 75121ms
rtt min/avg/max/mdev = 36.401/37.772/41.574/1.952 ms
real 1m15.626s
user 0m0.005s
sys 0m0.004s
Comments
If I ping the IP it resolves to, it acts normally. Also if I specify -c1.
DNS lookup slowing it down?
Maybe due to the fast interval.
Edit: Try it with different DNS resolvers.
DNS returns right away. It seems to happen with any interval.
The PTR records for that domain have not been setup. That's what causes the latency.
If you do
ltrace ping aardvark.org
, you will see it pause at thegetnameinfo
call.PING first does a DNS lookup for the domain (to connect), and then does a reverse lookup for formatting the output.
Ah, got it. Thanks!