DNS resolvers config not working, stuck with 127.0.0.1

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? :slight_smile:

Thanks!

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.

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?

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.

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

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

ping -c 1 one.one.one.one
ping -4 -c 1 one.one.one.one
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)

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:///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.

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 :sunglasses:

DELETED BY AUTHOR - IRRELEVANT TO THIS TOPIC

abcd567
thx for your message but it did not have any relation to the original issue.

Joulinar
Thanks for pointing out about non-relevance of my post to this topic. Actually it looked similar to my issue which caused me to post the solution. I will now delete my post (if a provision is there), otherwise I request administrator to please delete my post. Thank you.