The hostname is the name of the computer as it appears to networking applications. Changing it only requires modifying a couple files in Debian.

Part 1
Part 1 of 2:
Edit /etc/hostname

  1. 1
    Open a terminal window, TTY console, or secure shell to the Debian machine.
  2. 2
    Enter "sudo nano /etc/hostname". Enter your password when prompted. This runs the nano text editor as root and opens the file.
  3. 3
    Replace your current hostname with the one you want to change it to. Press Ctrl-O and then Enter to save it, and then press Ctrl-X to exit nano.

Part 2
Part 2 of 2:
Edit /etc/hosts

  1. 1
  2. 2
    Find the line that starts with "127.0.1.1". Your old hostname should appear after it. Replace it with your new one, save, and then exit.
  3. 3

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time.
How helpful is this?
Co-authors: 1
Updated: September 15, 2021
Views: 700
Categories: Linux