ping waits 5 seconds between packets if RDNS is not present

Bug #737959 reported by gjarboni
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

If you use ping from the command line and the host you are pinging does not have a rDNS entry, then ping pauses for 5 seconds or more between packets. Since there's no output on the terminal it looks as if the host is down, but when you press Ctrl-C, you get a line about the first packet.

Here's the output from ping as well as a packet capture. b.b.b.b doesn't have an rDNS entry, but c.c.c.c does.

a.a.a.a = my ip address
b.b.b.b = pinged.machine.com
c.c.c.c = 2nd.pinged.machine.com
d.d.d.d = first dns server in resolv.conf

21:56:10.348040 IP a.a.a.a.35806 > d.d.d.d.domain: 19049+ A? pinged.machine.com. (39)
21:56:10.359921 IP d.d.d.d.domain > a.a.a.a.35806: 19049* 1/0/0 A[|domain]
21:56:10.401162 IP a.a.a.a.35806 > d.d.d.d.domain: 10575+ PTR? b.b.b.b.in-addr.arpa. (44)
21:56:10.413424 IP d.d.d.d.domain > a.a.a.a.35806: 10575 NXDomain 0/1/0 (121)
21:56:15.497545 IP a.a.a.a.35806 > d.d.d.d.domain: 60024+ PTR? b.b.b.b.in-addr.arpa. (44)
21:56:15.509826 IP d.d.d.d.domain > a.a.a.a.35806: 60024 NXDomain 0/1/0 (121)
21:56:20.588606 IP a.a.a.a.35806 > d.d.d.d.domain: 28660+ PTR? b.b.b.b.in-addr.arpa. (44)
21:56:20.624358 IP d.d.d.d.domain > a.a.a.a.35806: 28660 NXDomain 0/1/0 (121)
21:56:25.671853 IP a.a.a.a.35806 > d.d.d.d.domain: 63426+ PTR? b.b.b.b.in-addr.arpa. (44)
21:56:25.684198 IP d.d.d.d.domain > a.a.a.a.35806: 63426 NXDomain 0/1/0 (121)

me@me-desktop:~/Desktop$ ping pinged.machine.com
PING pinged.machine.com (b.b.b.b) 56(84) bytes of data.
64 bytes from b.b.b.b: icmp_seq=1 ttl=124 time=41.0 ms
64 bytes from b.b.b.b: icmp_seq=2 ttl=124 time=81.0 ms
64 bytes from b.b.b.b: icmp_seq=3 ttl=124 time=76.1 ms
64 bytes from b.b.b.b: icmp_seq=4 ttl=124 time=43.3 ms

--- pinged.machine.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 15268ms
rtt min/avg/max/mdev = 41.009/60.377/81.041/18.299 ms
me@me-desktop:~/Desktop$

22:15:38.966121 IP a.a.a.a.35806 > d.d.d.d.domain: 61313+ A? 2nd.machine.pinged.com. (42)
22:15:38.966447 IP a.a.a.a.35807 > d.d.d.d.domain: 44215+ PTR? b.b.b.b.in-addr.arpa. (43)
22:15:38.978502 IP d.d.d.d.domain > a.a.a.a.35806: 61313* 1/0/0 (58)
22:15:38.980133 IP d.d.d.d.domain > a.a.a.a.35807: 44215 NXDomain* 0/1/0 (127)
22:15:38.995406 IP a.a.a.a.35808 > d.d.d.d.domain: 45092+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:39.017572 IP d.d.d.d.domain > a.a.a.a.35808: 45092* 1/0/0 (81)
22:15:39.991054 IP a.a.a.a.35808 > d.d.d.d.domain: 48973+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:40.002881 IP d.d.d.d.domain > a.a.a.a.35808: 48973* 1/0/0 (81)
22:15:40.998392 IP a.a.a.a.35808 > d.d.d.d.domain: 78+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:41.010430 IP d.d.d.d.domain > a.a.a.a.35808: 78* 1/0/0 (81)
22:15:41.988781 IP a.a.a.a.35808 > d.d.d.d.domain: 21736+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:42.000789 IP d.d.d.d.domain > a.a.a.a.35808: 21736* 1/0/0 (81)
22:15:42.996923 IP a.a.a.a.35808 > d.d.d.d.domain: 43427+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:43.009297 IP d.d.d.d.domain > a.a.a.a.35808: 43427* 1/0/0 (81)
22:15:43.984441 IP a.a.a.a.35808 > d.d.d.d.domain: 59199+ PTR? a.a.a.a.in-addr.arpa. (41)
22:15:43.997827 IP a.a.a.a.35809 > d.d.d.d.domain: 23386+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:44.009554 IP d.d.d.d.domain > a.a.a.a.35809: 23386* 1/0/0 (81)
22:15:44.036071 IP d.d.d.d.domain > a.a.a.a.35808: 59199 NXDomain*- 0/1/0 (118)
22:15:44.990557 IP a.a.a.a.35809 > d.d.d.d.domain: 51955+ PTR? c.c.c.c.in-addr.arpa. (43)
22:15:45.002374 IP d.d.d.d.domain > a.a.a.a.35809: 51955* 1/0/0 (81)

me@me-desktop:~/Desktop$ ping 2nd.machine.pinged.com
PING 2nd.machine.pinged.com (c.c.c.c) 56(84) bytes of data.
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=1 ttl=127 time=12.1 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=2 ttl=127 time=18.7 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=3 ttl=127 time=18.3 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=4 ttl=127 time=21.9 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=5 ttl=127 time=12.3 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=6 ttl=127 time=11.8 ms
64 bytes from 2nd.machine.pinged.com (c.c.c.c): icmp_seq=7 ttl=127 time=16.2 ms

--- 2nd.machine.pinged.com ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7018ms
rtt min/avg/max/mdev = 11.894/16.067/21.995/3.431 ms
me@me-desktop:~/Desktop$

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: iputils-ping 3:20071127-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-27.49-generic-pae 2.6.32.26+drm33.12
Uname: Linux 2.6.32-27-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
Date: Fri Mar 18 21:50:08 2011
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: iputils

Revision history for this message
gjarboni (jmitchel) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iputils (Ubuntu):
status: New → Confirmed
Revision history for this message
Martijn Lievaart (j-launchpad-net-rtij-nl) wrote :

The same issue is described here: http://www.unchartedbackwaters.co.uk/pyblosxom/debian_ubuntu_dns_resolution_delays

I can confirm that removing mdns4 makes the problem go away. So it's really https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/94940, please merge.

Revision history for this message
gjarboni (jmitchel) wrote : Re: [Bug 737959] Re: ping waits 5 seconds between packets if RDNS is not present

> The same issue is described here:
> http://www.unchartedbackwaters.co.uk/pyblosxom/debian_ubuntu_dns_resolution_delays
>
> I can confirm that removing mdns4 makes the problem go away. So it's
> really https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/94940,
> please merge.
>
> --
There are actually two bugs -- the mDNS bug that you described and the
fact that ping is doing a DNS lookup before sending each packet. I don't
know of another operating system that does this. Usually they do one
lookup before pinging, then none while pinging. Doing a ping before every
packet is my mind is just silly.

Revision history for this message
Martijn Lievaart (j-launchpad-net-rtij-nl) wrote :

jmitchel,

That's actually very weird, because ping *does* cache (and incorrectly: https://bugs.launchpad.net/ubuntu/+source/iputils/+bug/1405232).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.