Skip to content

Instantly share code, notes, and snippets.

@tstellanova
Last active March 3, 2024 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstellanova/94838ddf94c4507a85e972b65526aed4 to your computer and use it in GitHub Desktop.
Save tstellanova/94838ddf94c4507a85e972b65526aed4 to your computer and use it in GitHub Desktop.
Configure hostname on raspberry Pi3 (RPi3), RPi4, CM4 and similar

Set the hostname

sudo vi /etc/hosts
# replace raspberrypi with your desired hostname, and save
sudo vi /etc/hostname
# replace raspberrypi with your desired hostname, and save
# you will get a warning about "sudo: unable to resolve host raspberrypi" after save
sudo reboot
  • The host should now be available on hostname.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment