Hostname is stored in
/etc/hostname file on Debian. This file is read at the boot time and name is setup using the init script
To make changes to the hostname, first edit this file as follows:
#sudo gedit /etc/hostname
Once you’re done editing the hostname, save the file and run the following command to set the hostname.
#sudo /etc/init.d/hostname.sh start
Now, check and confirm your hostname.