The easiest way to find your Raspberry Pi’s hostname is through the command line interface (CLI). Follow these simple steps to check it.

The hostname is a unique identifier for your Raspberry Pi on a local network or the internet. Knowing its hostname can be useful when accessing it remotely, configuring network settings, and more. In …


Updated August 3, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


The hostname is a unique identifier for your Raspberry Pi on a local network or the internet. Knowing its hostname can be useful when accessing it remotely, configuring network settings, and more. In this article, we’ll show you how to find your Raspberry Pi’s hostname using the command line interface (CLI).

  1. Open a terminal window on your Raspberry Pi by clicking on the icon in the top left corner of the desktop or by pressing Ctrl + Alt + T.
  2. Type hostname and press Enter. This will display the hostname of your Raspberry Pi.

For example:

pi@raspberrypi:~ $ hostname
raspberrypi

In this case, the hostname is “raspberrypi”. If you want to change it, follow these steps:

  1. Open the sudo nano /etc/hostname file by typing sudo nano /etc/hostname in the terminal and pressing Enter. This will open the hostname configuration file with nano text editor.
  2. Replace the current hostname with your desired one. Save the changes by pressing Ctrl + O, then exit nano by pressing Ctrl + X.
  3. Open the sudo nano /etc/hosts file and replace all instances of the old hostname with the new one using Ctrl + W. Save the changes and exit nano as before.
  4. Reboot your Raspberry Pi to apply the changes by typing sudo reboot and pressing Enter.
  5. After the reboot, check if the hostname has been changed correctly by running hostname in the terminal again.