Home > How To, Raspberry pi, Technology > Changing Hostname on Raspberrypi

Changing Hostname on Raspberrypi


Being the proud owner of two Raspberry Pi’s I found because they use the same Image they also have the same Hostname so to change it I had to do the following

1) Edit the hostname file with the following command

sudo nano /etc/hostname

(Sudo means run as)(nano is the file edit program)(/etc/hostname is the file location)

If it is the standard image you should see RaspberryPi change this to any thing you want as long as it is one word.

Then do the following to save the changes

CTRL + X and then Y

2) Edit the hosts file with the following command

sudo nano /etc/hosts

(Sudo means run as)(nano is the file edit program)(/etc/hosts is the file location)

If it is the standard image you should see next to 127.0.1.1 the following RaspberryPi change this to the same name as your hostname.

Then do the following to save the changes

CTRL + X and then Y

To make sure it saved the file type the following command

cat  /etc/hosts

If all has gone correct you should now see next to 127.0.1.1 your new host name

3) Issue the reboot command with the following command

sudo reboot

When you next login to your RaspberryPi you should see the new host name in the prompt.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

raspberrypicloud

The University of Glasgow's Raspberry Pi Project

Tech-o-rama

Your all round solution for tech problems (and some others things...like spelling errors)

thedomesticfringe.com/

telling stories - making memories

Raspberry Pi Kid

A 14-year old's adventures with Raspberry Pi

Naked Security

Computer Security News, Advice and Research

Grumpy IT Girl

I'm not a very good writer

Dustin Software

Because programming is fun!

Pinoy Tekkie

USER-FRIENDLY TECHNOLOGIES FOR THE PINOY NOOBIES

petRockBlog

Fun stuff for technics enthusiasts

I Kissed My Date Goodnight

Embarking on motherhood through the miracle of adoption.

projectz

Tech, Gadgets, Photography, Social Media and Poor Spelling

Programming My Rasberry Pi

A brave fool's adventures into the unknown!

Chris Ainger's Blog

Where Fishing Meets Computing

PIPAL

Information wants to be free

ITtechExec: Protecting Tech Careers Since 2001

Technical Career Advancement: Transformed. Guaranteed.

CRUNCHEDD

Entertainment, Technology, Social Media Updates from in Between the Web…

StartupTunes

An Exclusive Web 2.0 Startups Review Blog

The Life of Me

Just another IT blog

NJrajgelani

The Best Place for Deziners

%d bloggers like this: