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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.