After the confirmation, you will be back on the main menu.Confirm (Enter) and type your new hostname.You’ll get a message about the letters you can use (a-z, 0-9 and -).Use the arrows to select the corresponding line and press enter to confirm. Then click on “Hostname” (press enter).Note: if you are using an old version of Raspberry Pi OS, the hostname option might be under “Network options” instead of “System options”. On the wizard that shows up, click on “System options” (just press Enter).Here is how to change the hostname in raspi-config: You probably already know this tool, as you can use it to change many things in your Raspberry Pi configuration. You can also check the last one if you are on Raspberry Pi OS with Desktop. It can be easier if you can’t remember the filename to edit, or are not comfortable with a terminal, especially with editing files. The next two solutions are only available on Raspberry Pi OS. You can use the same method on systems like Debian and Ubuntu. Edit the last line to update the Raspberry Pi name.If you have some issues (or warnings at least) with some network services, you probably need to edit the /etc/hosts file to update the localhost name: Once restarted, the new hostname will appear in the command prompt.Īnd, you can also check with the hostname command:. ![]() You need to reboot the Raspberry Pi to apply changes: If you use the hostname command now, the value will still be the same.Save the file and exit (CTRL+O, CTRL+X).Remove the word and replace it with the one you want, for example:.A file opens that only contains the default hostname: “raspberrypi”.On Raspberry Pi OS (and any Linux system, I think), this file is /etc/hostname. There is a file on most systems with the device hostname inside. This solution is great because it works on almost any Linux distribution. Solution 2: Edit the configuration file Open and edit the /etc/hostname file Please don’t hesitate to check it before going further. If you are not used to this tool, I have a complete guide for Raspberry Pi Imager here. So, check the following solutions if you are not using Raspberry Pi OS. The only issue with this solution, is that it works on Raspberry Pi OS, should work with other Debian-based distributions (not all the time) and won’t work on custom images and other systems. Just remember to change it if you have several Raspberry Pi, as it will use it every time you flash a new SD card (if you chose “to always use” in the first list). The hostname will be set as requested on the first boot. Then, click on “Write” as usual to start the flashing process.Click on it to open the advanced options, and fill the first field with the desired hostname.Then, you’ll see a button appeared in the bottom-right corner:.Pick the media where you’ll install your system.Select the Raspberry Pi OS version you want to install.It will save the name you choose on the sd card, and use it instead of the default value on the first boot. If you use Raspberry Pi Imager to install a new system (especially for Raspberry Pi OS), you can now use the advanced options to set the new hostname directly. I will show you four different ways to do this now. Let’s look at how to change the default hostname to a custom name. ![]() How to change the hostname on Raspberry Pi
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |