12

During Debian installation, I set my hostname to the wrong value, and now I would like to correct that.

3 Answers 3

12

The hostname is stored in three different files:

  • /etc/hostname Used as the hostname
  • /etc/hosts Helps resolving the hostname to an IP address
  • /etc/mailname Determines 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.

3

The value is stored in /etc/hostname. After modifying, apply it with /etc/init.d/hostname start

1
  • 1
    This fails in Debian 6. Which version are you using? Commented Jul 27, 2011 at 11:07
0

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.