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=
static routers=
static domain_name_servers=

Save and Done!

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

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

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