Book Image

Troubleshooting CentOS

By : Jonathan Hobson
Book Image

Troubleshooting CentOS

By: Jonathan Hobson

Overview of this book

Table of Contents (17 chapters)
Troubleshooting CentOS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Changing the hostname and managing the FQDN


Changing the hostname of an authoritative or a recursive (caching) server may not necessarily be a DNS issue (per se), but, as a rule of thumb, the hostname of your system is inextricably linked to the DNS as a function of the overall system in question; for this reason, we will now review the procedure to change the hostname of the host system.

To review the current hostname, you can use the following syntax:

# hostnamectl status

However, you can choose to view the static, transient, or pretty name with one of the following commands:

# hostnamectl status --static
# hostnamectl status --transient
# hostnamectl status --pretty

Based on this, to change the hostname you should use the following command:

# hostnamectl set-hostname <new-host-name>

Alternatively, you can choose to update the static hostname with this:

# hostnamectl --static set-hostname <new-host-name>

Having completed this action, the hostname change will be applied to the...