Domain name within the output of ping command.

Solution Verified - Updated -

Issue

  • Identical configuration of two systems, produce different ping output when the ping is run locally.
  • Why the output of ping command is inconsistent and where is it taken from?
[root@testmachine1 ~]$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

[root@testmachine1 ~]# ping testmachine1
PING testmachine1.example.com (10.10.10.10) 56(84) bytes of data.
64 bytes from testmachine1 (10.10.10.10): icmp_seq=1 ttl=64 time=0.013 ms
64 bytes from testmachine1 (10.10.10.10): icmp_seq=2 ttl=64 time=0.028 ms

[root@testmachine2 ~]#$ cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

[root@testmachine2 ~]# ping testmachine2
PING testmachine2.example.com (10.10.10.20) 56(84) bytes of data.
64 bytes from testmachine2.example.com (10.10.10.20): icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from testmachine2.example.com (10.10.10.20): icmp_seq=2 ttl=64 time=0.028 ms

Environment

  • Red Hat Enterprise Linux
  • ping

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content