Bug 4912

Summary: Red Hat 5.2 ping doesn't perform reverse name lookup
Product: [Retired] Red Hat Linux Reporter: Stephen J. Friedl <steve>
Component: netkit-baseAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-12 20:21:34 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:
Attachments:
Description Flags
Patch to allow ping to lookup names from IP addresses none

Description Stephen J. Friedl 1999-09-04 18:06:23 UTC
Ping does not look up the inverse-DNS name in the
"bytes received..." lines and it should. Normally
the "-n" cmdline parameter suppresses this, but in
netkit-base-0.10 it simply never looks it up at all.

The fix is easy: search for "bytes received" in ping.c
and change the next line as:

689c689
<  pr_addr(from->sin_addr.s_addr),
---
>  inet_ntoa(*(struct in_addr *)&from->sin_addr.s_addr),

This does the right thing.

Comment 1 Stephen J. Friedl 1999-12-22 10:23:59 UTC
Bug still present (on same line number) in i386 RHL 6.1, same fix works too

Comment 2 Stephen J. Friedl 2000-02-25 23:12:59 UTC
Created attachment 132 [details]
Patch to allow ping to lookup names from IP addresses

Comment 3 Jeff Johnson 2000-03-05 17:52:59 UTC
Printing the ip address used rather than the reverse lookup DNS name is less
ambigous on multihomed hosts. There are also far too many scripts that use ping
that expect an IP address, not a hostname in the output. I can't change that
output in ping.

Comment 4 Stephen J. Friedl 2000-03-05 20:57:59 UTC
Please reconsider. All non-Linux pings that I know of return the IP
address *and* the name in their response, and this is very handy. The
output "should" look like:

$ ping www.yahoo.com
PING www.yahoo.com (204.71.200.68): 56 data bytes
64 bytes from www3.yahoo.com (204.71.200.68): icmp_seq=0 ttl=249 time=67.4 ms
...

but the current version of netkit-base (0.10) includes only the IP address:

$ ping www.yahoo.com
PING www.yahoo.com (204.71.200.67): 56 data bytes
64 bytes from 204.71.200.67: icmp_seq=0 ttl=249 time=111.8 ms
...

The patch provided turns ping#2 into ping#1, and it also works without
change on netkit-base-0.16 from the netkit maintainers. They have assigned
bug [netbug 234] to this on 2000-03-05.

Comment 5 Jeff Johnson 2000-03-12 20:21:59 UTC
Reverse name lookup has been added in the Red Hat 6.2 iputils-20000121-2
ping. Good luck with netkit, and thanks for poing me!