Last Updated: September 29, 2017
·
9.342K
· jmcveigh

Setting the fully qualified domain name for a Fedora server

The fully qualified domain name (FQDN) for a Fedora server is the identifying name, as a point of access, for a server. Please, upon successful installation of Fedora, consult the system administrators guide to learn how best to set the fully qualified domain name.

To set up a network that is behind an Internet firewall or router, you may want to use hostname.localdomain for your Fedora system. If you have more than one computer on this network, you should give each one a separate host name in this domain.

On some networks, the DHCP provider also provides the name of the computer, or hostname. The complete hostname includes both the name of the machine and the name of the domain of which it is a member, such as machine1.example.com. The machine name is machine1, and the domain name is example.com.

If your Fedora system is connected directly to the Internet, you must pay attention to additional considerations to avoid service interruptions or risk action by your upstream service provider. A full discussion of these issues is beyond the scope of this document.

The command line interface to work with the fully qualified domain name of a Fedora system is as follows :

[root@localhost] : hostname
localhost.localdomain
[root@localhost] : echo 'machine1.example.com' > /etc/hostname
[root@localhost] : hostname -f /etc/hostname

Also, it is best to change the file at the location /etc/hosts. In this file, put the outward facing IP address followed by it's aliases:

[root@localhost] : echo '69.89.31.226    machine1 machine1.example.com' >> /etc/hosts
[root@localhost] : echo '2002:4559:1fe2::4559:1fe2 machine1 machine1.example.com' >> /etc/hosts

Once completed, please follow best practices for DNS configuration using the preferred method for your system. Ideally, this DNS configuration will include both an A record as well as an AAAA record for the machine which will point to an outward facing IP address. This outward facing IP address could be one of the network interface cards for the machine, or, in the case more than one connection is required, a load balancer.

1 Response
Add your response

For what it's worth, you actually want the -F flag, not -f; -F forces a read from the following file while -f only displays the FQDN of the host.

over 1 year ago ·