Table of Contents

How to see and update the Fully Qualified Domain Name (FQDN) on Linux

About

This article shows you how to manage the Fully Qualified Domain Name (FQDN) in Linux

Management

Get

You can check:

hostname -f
# or 
hostname --fqdn
dnsdomainname
# same as
hostname -d

Set

Host file

The recommended method of setting the FQDN is to make the hostname be an alias for the fully qualified name using host file (ie /etc/hosts), DNS, or NIS.

For example, if the hostname was “ursula”, one might have a line in /etc/hosts which reads

127.0.1.1    ursula.example.com ursula

DNS resolver

in the search properties of the Linux - The DNS resolver (/etc/resolv.conf) file

Documentation / Reference