Fedora 20 : Removing domain info (converted to hyphens)

jayunit100 asked:

Im noticing that in Fedora 20, if I modify the HOSTNAME=…. parameter to include a typical hostname:

HOSTNAME=machine1.local

It actually replaces the “.” with a “-” character , and machine1.local is not pingable.

Why is fedora interchanging the “.” character with a dash, given that the “.” in a hostname has a very specific meaning, and is usually deliberate?

And my more important question: Whats the right way to set a fully qualified hostname on a local computer (I dont have DNS set up).

My answer:


In RHEL 7 and recent Fedora, the system hostname is no longer set in the /etc/sysconfig/network file. It is now set in the /etc/hostname file, which should contain only the fully qualified domain name.

# cat /etc/hostname
saurok.example.com
#

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.