HOWTO Rename a Debian system

This article was first written in December 2004 for the BeezNest technical
website (

To rename a Debian system, it is not enough to change the /etc/hostname file, you probably need to change some references to the old name elsewhere. This article tries to pinpoint the files where it would be needed to change it. Be careful, the name may also be configured in specific applications, like in some databases.

System files, where changes are mandatory

  • /etc/hostname
  • /etc/hosts
  • /etc/mailname
  • Configuration files for the MTA used

Application files, depending on the program

It is not possible to list every possible application configuration file where the name may have been hardcoded. So the simplest way to detect them is to do the following:

# rgrep -i oldname /etc/*

where oldname is the previous hostname.

And of course, don’t forget to change the name references on other machines of the network also, where it applies.

Related Posts

Installing SoulFu on Ubuntu 12.04 64bit

If you ever want to install the amazing multiplayer SoulFu medieval-fantasy game from...

HOWTO Use the /etc/cron.* infrastructure on Debian

This article is incomplete and was first written in June 2006 for the...