Set fixed IP-adress to Raspberry Pi running Raspbian

Set a fixed IP-adress to a raspberry Pi running Raspbian:

open up /etc/dhcpcd.conf with a text editor.

sudo nano /etc/dhcpcd.conf

Scroll down until you see the line static ip_address=. Uncomment that line Then add some stuff (fill the ip-adresses with something relevant to your network.

interface eth0
static ip_address=192.168.2.200/24
static routers=192.168.2.1
static domain_name_servers=1.1.1.1

Save and Done!

You could use external DNS-servers instead of those by your own ISP:

Cloudflare – 1.1.1.1 (They say it is fast… Haven’t tested)
Google – 8.8.8.8, 8.8.4.4 (dependable but zero trust)
OpenDNS – 208.67.222.222, 208.67.220.220 (they claim not to log your DNS-requests)

If you have your own DNS-server use that one.