- First, check your current hostname:
$ hostname server1 $ hostname --fqdn server1
At this point both, the hostname and FQDN is set to
server1
.Optionally, change your hostname before proceeding to the next step.
- As an example now we will define hostname
server1
as retrieved in the previous step to be an alias for the fully qualified domain namewww.linuxconfig.org
on the IP address1.2.3.4
. To do so edit the/etc/hosts
file by using thesudoedit /etc/hosts
command and add the following line:1.2.3.4 www.linuxconfig.org server1
NOTE
The order is important! The FQDNwww.linuxconfig.org
must precede the hostnameserver1
. - All done and no reboot required. Check your FQDN by using the
hostname
command:$ hostname --fqdn www.linuxconfig.org
Alternatively, also check your domain name:
$ dnsdomainname linuxconfig.org
How to change FQDN ( domain name ) on Ubuntu 20.04
- 3211 Пользователи нашли это полезным