SamSaBal
Posts: 3
Joined: Fri Mar 06, 2020 8:26 am

Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 8:41 am

I have a raspberry pi 4, and in the /etc/dhcpcd.conffile i change the paramaters to give the pi a static ip (that works great) but the static domain_name_servers doenst work, i have it set to 8.8.8.8 and 8.8.4.4 but if i reboot my pi, it still says (in the /etc/resolve.conf) that the dns is 127.0.0.1, does anybody know how to solve this?

extra note, in my router i have set the primairy dns to my pi, the secondary is set to 8.8.8.8, my pc gets the primary DNS
Attachments
DNS-02.PNG
DNS-02.PNG (28.24 KiB) Viewed 212 times
DNS-01.PNG
DNS-01.PNG (18.76 KiB) Viewed 212 times

pcmanbob
Posts: 9612
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 10:46 am

SamSaBal wrote:
Fri Mar 06, 2020 8:41 am
extra note, in my router i have set the primairy dns to my pi, the secondary is set to 8.8.8.8, my pc gets the primary DNS
Hi,

Why have you set the router primary DNS to you pi IP ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

SamSaBal
Posts: 3
Joined: Fri Mar 06, 2020 8:26 am

Re: Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 10:49 am

I use pi-hole to have an ad free network

pcmanbob
Posts: 9612
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 10:59 am

Then having nameserver 127.0.0.1 is correct, because its pointing to your own DNS server that's running as part of pihole, that's how pihole is able it intercept the requests for the add sites.

once pihole has done its set up you should not be making manual changes as you could end up breaking your pihole,
pihole makes all the necessary changes to make it work as part of the setup, including setting a static IP and all nameserver settings.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

SamSaBal
Posts: 3
Joined: Fri Mar 06, 2020 8:26 am

Re: Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 11:25 am

okay, i was already thinking it would be something like that.
Thanks for clarifying tho!!

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Raspberry pi 4 doens't pick up specified DNS

Fri Mar 06, 2020 1:40 pm

I was under the impression that Pihole sets the DNS server to 127.0.0.1 by means of an entry at the bottom of /etc/dhcpcd.conf, like this:

interface eth0
static ip_address=192.168.1.12/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1

Is your eth0 stanza higher up the file?

Return to “Beginners”