During Debian installation, I set my hostname to the wrong value, and now I would like to correct that.
The hostname is stored in three different files:
/etc/hostnameUsed as the hostname
/etc/hostsHelps resolving the hostname to an IP address
/etc/mailnameDetermines the hostname the mail server identifies itself
You might want to have a deeper look with
grep -ir hostname /etc
Restarting affected services might be a good idea as well.
The value is stored in
/etc/hostname. After modifying, apply it with
Various services may also depend on being able to resolve the hostname locally, which is often handled by an entry in the /etc/hosts file.