Howto redefine the hostname on Debian/Ubuntu

Just a small procedure as a self-reminder (I seem to have to use it just seldom enough to forget it each time – thanks Marvil):

  • define the new hostname on the localhost line (after localhost) in /etc/hosts
  • set the new name in /etc/hostname
  • issue a “hostname -F /etc/hostname
  • done
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone
Posted in:


  1. Heu, tu devrais aussi faire gaffe à /etc/mailname, et franchement, le nom local ne devrait presque jamais se trouver sur la ligne, à part pour les machines avec une adresse publique qui change souvent.

Leave a Reply

Your email address will not be published. Required fields are marked *