The `hostname -f` and `hostname -d` Return Incorrect Values Due to Misconfigured `/etc/hosts`
Issue
The system hostname commands return incorrect or incomplete values:
hostname -freturns only the short hostname (server1)hostname -dreturns nothinghostname --all-fqdnsonly showsserver1
Environment
- Red Hat Enterprise Linux (RHEL) 6 / 7 / 8 / 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.