How to change FQDN ( domain name ) on Ubuntu 20.04 Focal Fossa Linux - LinuxConfig.org

In this tutorial you will learn how to set / change server's Fully Qualified Domain Name (FQDN) on Ubuntu Ubuntu 20.04 Focal Fossa Linux server or desktop
This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-change-fqdn-domain-name-on-ubuntu-20-04-focal-fossa-linux

Hi :slight_smile:

I try to obtain Hostname and Domain Name from DHCP in Ubuntu 20.04. Both settings are in the lease (dhclient.lease) as
option host-name “machine”;
option domain-name “example[dot]org”;

Unfortunately I got only the hostname by executing “hostname -f”

Hi BrassPeddler,

Welcome to our forums.

Try setting your hostname in /etc/hostname to localhost, and reboot.