This tutorial explains how to set or the change hostname from the command line on your Linux server. The hostname is also often referred to as a Fully Qualified Domain Name
(FQDN hostname).
1. Display hostname.
Use the following command to display your server hostname.
Command: hostname -f
You can add the -f
flag stands for full
, because in some cases only a part of the actual hostname may be visible.
2. Set a new hostname.
Command: hostname <new_hostname>
Command: hostnamectl set-hostname <new_hostname>
3. Other methods.
If none of the above examples work, you can edit the /etc/hostname
file and the/etc/hosts
file and replace the default occurrences of the hostname
with the correct one.
Pingback: How to install cPanel WHM on your CentOS 6, 7? - Tiny Tumbleweed
Pingback: How to install CentOS Web Panel on CentOS 7 OS? - Tiny Tumbleweed
Pingback: How to install Vesta Control Panel on CentOS 7? - Tiny Tumbleweed
Pingback: How to install Virtualmin on CentOS 7? – Tiny Tumbleweed
Pingback: How to install Kloxo MR panel on CentOS 7? – Tiny Tumbleweed
Pingback: Fully Qualified Domain Name (FQDN) – Tiny Tumbleweed