submit to reddit       

Change your Raspberry Pi's hostname

Computers have hostnames so that they can be addressed by a human readable name as well as by their IP address. The default hostname for your Raspberry Pi is raspberrypi.

You might want to change it if you have more than one Pi, or just to make your Pi your own. Changing the hostname is very easy. You just need to open two files, /etc/hosts and /etc/hostname, and replace the word raspberrypi with your chosen hostname. These files are owned by root, so you need to open them as root. I changed my Pi's hostname to rpi. The contents of /etc/hostname is simply


/etc/hosts should look like this: localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters rpi

Reboot your Pi using this command:

sudo reboot

When you open a terminal, the prompt should look like this:

pi@rpi ~$



comments powered by Disqus

Follow me