How to Set the Hostname

How to set your system’s hostname and FQDN (fully qualified domain name).

Your hostname should be something unique! The system’s hostname has no relationship to websites or email services hosted on it – it just provides a name for the system itself. Your hostname should NOT be “www” or anything else overly generic.

Issue the following commands to set the hostname, replacing “alphabet” with the hostname of your choice:

root@zero:/# echo "alphabet" > /etc/hostname
root@zero:/# hostname -F /etc/hostname

Edit the file “/etc/default/dhcpcd” (ff it exists) to comment out the “SET_HOSTNAME” directive:

File excerpt: /etc/default/dhcpcd

#SET_HOSTNAME='yes'

And then Update /etc/hosts.

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
How to Set the Hostname, 5.0 out of 5 based on 1 rating

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>