Bug 4912 - Red Hat 5.2 ping doesn't perform reverse name lookup
Red Hat 5.2 ping doesn't perform reverse name lookup
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: netkit-base (Show other bugs)
6.1
All Linux
low Severity low
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-04 14:06 EDT by Stephen J. Friedl
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-03-12 15:21:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to allow ping to lookup names from IP addresses (1.17 KB, patch)
2000-02-25 18:12 EST, Stephen J. Friedl
no flags Details | Diff

  None (edit)
Description Stephen J. Friedl 1999-09-04 14:06:23 EDT
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 05:23:59 EST
Bug still present (on same line number) in i386 RHL 6.1, same fix works too
Comment 2 Stephen J. Friedl 2000-02-25 18:12:59 EST
Created attachment 132 [details]
Patch to allow ping to lookup names from IP addresses
Comment 3 Jeff Johnson 2000-03-05 12:52:59 EST
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 15:57:59 EST
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 15:21:59 EST
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!

Note You need to log in before you can comment on or make changes to this bug.