Change Hostname of Linux, CentOS, Ubuntu and Debian
Posted by RAJU K, Last modified by RAJU K on 25 January 2016 02:14 AM
|
|
Changing the HostnameYou’ll need to set your system’s hostname and fully qualified domain name (FQDN). Your hostname should be something unique. Note that the system’s hostname has no relationship to websites or email services hosted on it, aside from providing a name for the system itself. Your hostname should not be “www” or anything too generic. Hostname's examples, "server1", "wwwbox2", or "server50.mydomain.com".
CentOS 7 / Debian 8 / Fedora version 18 and above / Ubuntu 15.04Replace hostnamectl set-hostname hostname
Debian 7 / Slackware / Ubuntu 14.04Replace
Check if the file
If so, edit it and comment out the
CentOS 6 / Fedora version 17 and belowReplace
Update /etc/hostsNext, edit your
If you have IPv6 enabled on your Linode, you will also want to add an entry for your IPv6 address, as shown in this example:
| |
|