[solved]Centos 7 ignores FQDN/Domain configuration settings upon reboot

Issues related to configuring your network
Post Reply
kix
Posts: 23
Joined: 2018/06/10 22:56:42

[solved]Centos 7 ignores FQDN/Domain configuration settings upon reboot

Post by kix » 2018/08/13 19:44:26

I followed the instructions here (link), to change the FQDN/domain name of my Centos 7 system.

This includes using ViM editor to edit the fileslocated at: /etc/hostname

And then activating the hostname: hostname -F /etc/hostname

While in root mode.

When I perform a sudo reboot, and display the current configuration settings, it reverts back to the previous FQDN settings.

I have to execute the following each time: hostname -F /etc/hostname

For the desired FQDN to appear with the following command: hostname --fqdn
Each time after rebooting the server.

Edit: The following guide may have helped me resolve the issue. https://www.tecmint.com/set-hostname-pe ... -in-linux/
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: [solved]Centos 7 ignores FQDN/Domain configuration settings upon reboot

Post by MartinR » 2018/08/13 21:28:28

For a CentOS or RHEL system see the official documentation https://access.redhat.com/documentation ... host_names In particular note:
There are three classes of hostname: static, pretty, and transient.

The “static” host name is the traditional hostname, which can be chosen by the user, and is stored in the /etc/hostname file. The “transient” hostname is a dynamic host name maintained by the kernel. It is initialized to the static host name by default, whose value defaults to “localhost”. It can be changed by DHCP or mDNS at runtime. The “pretty” hostname is a free-form UTF8 host name for presentation to the user.

Post Reply