2

While implementing a static IP for my Raspberry I had to update /etc/dhcpcd.conf

interface eth0

static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

I noticed that without the static domain_name_servers= line I have no access to the internet, so why do I need a Domain Name Server with the same IP as my router for my Raspberry to connect to the internet?

2

The router line tells the Pi how to connect to the outside world. Without the domain name server line you can connect to other computers using their IP address. The following command would work

ping 8.8.8.8

The Domain Name Servers are like a phone book for the internet and provide the mapping between the human friendly name (such as raspberrypi.stackexchange.com) and the IP address (151.101.65.69).

In most home networks the router and the DNS (Domain Name Server) are one and the same, but in bigger networks they do not have to be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.