80 Domain Name Change Debian New

A similar question has been asked on serverfault.
Domain name change debian. Let us see all commands in details. Open the etc hostname to change the hostname. To set the hostname to server1 run.
Open the etc hosts to change the domain name and fqdn. You can add instead a domain alias to etc hosts. Login to your server.
Vi etc hosts verify it by running the hostnamectl command again. Ssh user server name become a root user using either sudo s or su. It is usually the hostname followed by the dns domain name the part after the first dot.
You can check the fqdn using hostname fqdn or the domain name using dnsdomainname. Change the domain and fqdn in the second line in the hosts file. For setting the domain name in debian you can edit etc hostname for a host hulefu in domain somewhere co uk you simply set etc hostname to hulefu somewhere co uk this should work for most other linux distributions too.