DNS resolvers config not working, stuck with 127.0.0.1 Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Romano2K
Posts: 6
Joined: Mon Jan 20, 2020 10:37 pm

DNS resolvers config not working, stuck with 127.0.0.1

Post by Romano2K »

Hi!

I'm using DietPi on a Raspberry Pi 3+ connected to my LAN via Wi-Fi.

It has been working properly until today.

According to /etc/resolv.conf and DietPi-Config, the DNS resolver is 127.0.0.1, despite the fact I've chosen CloudFlare in DietPi-Config and rebooted. Same if I edit /etc/dhcpcd.conf and reboot or relaunch dhcpcd.

So I cannot update DietPi, apt update, etc., as it can't resolve repositories domains, etc.

This Raspberry Pi is also running Pi-Hole, and I guess it interferes with DNS configuration, but I don't know how to handle this.

Any suggestion? :)

Thanks!
Attachments
Capture d’écran 2020-01-20 à 23.00.31.png
User avatar
Joulinar
Posts: 2052
Joined: Sat Nov 16, 2019 12:49 am

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Joulinar »

Hi,
many thanks for your report.

Yes if you have running PiHole, DNS resolver 127.0.0.1 is correct. Becasue your PiHole is working as DNS Server for your local Network and will answer all the DNS requests locally.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Romano2K
Posts: 6
Joined: Mon Jan 20, 2020 10:37 pm

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Romano2K »

Yes, but something must be wrong somewhere, probably with Pi-hole, as I can't resolve any new domain not already in cache.

I have months of Pi-hole logs and statistics that I'd like to keep, so I'm looking for a workaround to update everything without loosing anything.

Is there a simple way to temporarily override DNS resolvers?
User avatar
Joulinar
Posts: 2052
Joined: Sat Nov 16, 2019 12:49 am

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Joulinar »

First, pls try to reboot your system and check how it's behaving afterwards. Than we will start checking why DNS is not working as it should be. Btw, are you using IPv6 on your network? If not, can you check if it is disabled on dietpi-config.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Romano2K
Posts: 6
Joined: Mon Jan 20, 2020 10:37 pm

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Romano2K »

Went back to DietPi-Config > Network Options: Adapters > WiFi > Static DNS > Cloudflare > Ok > Apply, then Back > Back > Exit > Reboot? OK

After reboot, cat /etc/resolv.conf still returns nothing but "nameserver 127.0.0.1".

I'm using IPv6 and it's enabled in DietPi-Config!

Thank you for your help
User avatar
Joulinar
Posts: 2052
Joined: Sat Nov 16, 2019 12:49 am

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Joulinar »

you are not able to change DNS server as you are running PiHole. The question is why PiHole is not working correctly.

pls can you past output of following commands

Code: Select all

ping -c 1 one.one.one.one
ping -4 -c 1 one.one.one.one
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Romano2K
Posts: 6
Joined: Mon Jan 20, 2020 10:37 pm

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Romano2K »

Code: Select all

dietpi@DietPi:~$ ping -c 1 one.one.one.one
ping: one.one.one.one: Échec temporaire dans la résolution du nom
dietpi@DietPi:~$ ping -4 -c 1 one.one.one.one
ping: one.one.one.one: Échec temporaire dans la résolution du nom
(which I would translate to "Temporary fail of hostname resolution" in French)
Romano2K
Posts: 6
Joined: Mon Jan 20, 2020 10:37 pm

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Romano2K »

I've fixed it!

My Pi-hole was configured to use custom upstream DNS servers (in that case NextDNS servers).

Using Pi-hole Admin Console (http://pi.hole/admin or http://<IP>/admin), I've switched to Cloudflare's (Settings > DNS), restarted the DNS resolver (Settings > System), and it works.

I don't know why it didn't work with NextDNS, but I'll try after updating DietPi and Pi-hole.

I'll let you know, if this can help others.

Sorry Joulinar for taking your time for nearly nothing, thank you for offering your help.
Last edited by Romano2K on Mon Jan 20, 2020 11:59 pm, edited 2 times in total.
User avatar
Joulinar
Posts: 2052
Joined: Sat Nov 16, 2019 12:49 am

Re: DNS resolvers config not working, stuck with 127.0.0.1

Post by Joulinar »

not at all. I was just going to compile a post to check PiHole settings on the Admin panel. But good to have it solved now.

I personal always use 4 DNS server (2x Cloudflare & 2xQuad9) on my PiHole just to avoid that one of the services is failing. The other could backup in this case. My personal experience is, that actually Cloudflare is the fastes DNS.

EDIT:

I did some test on the fix entry in /etc/resolv.conf. Yep, using actual PiHole stable version v4.3.2 makes it quite challenging to change the local /etc/resolv.conf. But it seems this behavior might change with new Pihole version 5 (BETA). At least it seems managing settings in /etc/resolv.conf is possible again. But not sure if this is a bug on Beta or a new feature 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply