How do I change the hostname in Debian 9?
- Change the hostname using hostnamectl . In Debian 9, to change the system hostname and related settings you can use the hostnamectl command.
- Edit the /etc/hosts file. Open the /etc/hosts file and replace your old hostname with the new one.
What should my Debian hostname be? Change the System Hostname
It is recommended to use a fully-qualified domain name ( FQDN ) as the system hostname. There are two steps involved when changing the system hostname on Debian 10.
How do I change the hostname in Linux?
- Type the following command to edit /etc/hostname using nano or vi text editor: sudo nano /etc/hostname. Delete the old name and setup new name.
- Next Edit the /etc/hosts file: sudo nano /etc/hosts.
- Reboot the system to changes take effect: sudo reboot.
How do I change my hostname?
- Log in to Server Administration Panel.
- Go to Tools & Settings > Server Settings.
- Enter the new host name in the Full hostname field. This should be a fully qualified host name, but without an ending dot (for example, host.example.com ).
- Click OK.