How to give your Raspberry PI a Static IP
Bradly S

How to give your Raspberry Pi a Static IP Address

This small guide is mostly to accompany my other guide on how to turn your Raspberry Pi into an Alexa Smart Device, however, this may come of use to you if you’re falling upon this blog post!

I’ll try and make this as easy as possible to follow, generally speaking, the configuration for this will be the same across all Raspberry Pi versions in the future, but I will update this should I need to in the future.

To start with, you’ll want to open “Terminal”, or SSH (On a remote computer). Run the following command:

sudo nano /etc/dhcpcd.conf

From here, scroll to the bottom (Hold down on the Keyboard). The last line may say “nohook lookup-hostname”.

Copy and Paste the following, changing the details of the bolded numbers to the static IP you wish to keep:

interface eth0
static ip_address=
static routers=
static domain_name_servers=
interface wlan0
static ip_address=
static routers=
static domain_name_servers=

The routers= and domain_name_servers= would both equal the IP of your router if you live at home. Otherwise, the name_servers is the IP of your DNS records and the routers are the IP of your gateway.
You will need to keep the /24 at the end of the ip_address.

From here, press ctrl + x and then press Y to save changes. Simply reboot your Pi after and your Static IP will be done!

If you wish to check this, open Terminal again and type the following:

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to This site also participates in other affiliate programs and is compensated for referring traffic and business to these companies.

Want to get more out of your Smart Home?

Get Started Today with my 5-Day Smart Home Bootcamp!

Would love your thoughts, please comment.x