Why 'hostname -a' command is not showing all the host aliases mentioned in '/etc/hosts' file ?

Solution Verified - Updated -

Issue

  • /etc/hsots is configured as below:
[...]
155.176.X.X USxxx-APPxxxx0 USxxx-APPxxxx0.emxx.org 
155.176.Y.Y USxxx-APPxxxx1 USxxx-APPxxxx1.emxx.org
155.176.X.X xx0 xx0.emxx.org                 <<----
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  • hostname -a is returning hostname like below:
# hostname -a
USxxx-APPxxxx0.emxxx.org
  • why is not returning xx0 and xx0.emxx.org as well in hostname -a list ?

Environment

  • Red Hat Enterprise Linux (Any Version)

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