[SOLVED] curl: (28) Resolving timed out after 3000 milliseconds

Greetings Diet Pi Community,

I’ll keep this short - I was originally running a Diet Pi OS Installation on a Raspberry Pi 4B with Pi-Hole and Unbound, alongside my Media Server (Jellyfin), but decided to move the Pi-Hole + Unbound instances to a Pi Zero (no WiFi capabilities).

The Pi Zero has been running flawlessly (thanks Diet Pi) while only utilizing around 5% CPU and keeping a “cool runnings” of 95*F. I left on a road trip last week and found that all was well during and upon my return (no issues).

Being that our FOSS devices are usually needing an update after a few days, I attempted to update all of my Pi’s and Linux machines upon my return only to find that my Pi Zero (running Pi-Hole and Unbound) was not able to resolve any of the repositories (i.e.; not able to update via “apt update” or “apt upgrade”) needed to update the device and OS.

But, as I mentioned above, all “gears” are turning (Pi-Hole is actively blocking ads, and Unbound is actively [recursively] running). Below is my configuration of the hardware and software:

Hardware:
Raspberry Pi Zero (No WiFI - Micro USB OTG Cable > TP-Link USB-to-Ethernet Adapter > Router)

Software:
Pi-Hole + Unbound

Pi-Hole GUI:
Settings > DNS:
Upstream DNS Server: “127.0.0.1#5335”
Interface listening behavior: “Listen on all interfaces”

"Advanced DNS settings" are as follows:
“Never forward non-FQDNs” - Checked
“Never forward reverse lookups for private IP ranges” - Checked
“Use DNSSEC” - Unchecked (since I am not using DNSSEC)
“Use Conditional Forwarding” - Checked (using the proper input settings)

So, my question is: why would this be happening? (again, all functions of Pi-Hole and Unbound are working correctly - but the Pi and OS itself are unable to update due to failure to resolve).

Hi,

let’s check the DNS server settings on your device

cat /etc/resolv.conf
readlink -f /etc/resolv.conf

Try to run the apt update and then run a ping to the server.
E.g

dietpi@RockPi:[~]$ sudo apt update
Hit:1 https://deb.debian.org/debian buster InRelease
...

ping -c 3 deb.debian.org

Results:

root@DNSPi:~# cat /etc/resolv.conf
nameserver xxx.xxx.xxx.223



root@DNSPi:~# readlink -f /etc/resolv.conf
/etc/resolv.conf

Well… I can already tell you that it’s attempting to use my previous Raspberry Pi’s IP Address (the RPi 4B that used to be the home of my Pi-Hole and Unbound) and not “local host”. However, after running that on a different RPi, I receive the correct IP Address (of the Pi Zero currently running Pi-Hole and Unbound):

root@ServerPi:~# cat /etc/resolv.conf
domain warp
search warp
nameserver xxx.xxx.xxx.8



root@ServerPi:~# readlink -f /etc/resolv.conf
/etc/resolv.conf

I do not see how that could be possible since I started with a fresh install of the Diet Pi OS for both Pi’s (on the RPi 4B currently running my ProFTP File Server and Jellyfin Media Server, and the RPi Zero currently running Pi-Hole and Unbound). I also checked all of the settings within Pi-Hole and my router and cannot see the old IP Address anywhere…

As expected…

root@DNSPi:~# ping -c 3 deb.debian.org
ping: deb.debian.org: Temporary failure in name resolution

You can change /etc/resolv.conf yourself pointing to correct IP or you use dietpi-config to set correct DNS server

…I have to admit that this is a bit of a mystery. There should be no reason for the nameserver to show as .223 on the Pi-Hole + Unbound RPi Zero since, as I mentioned, I started with a fresh OS install on both Pi’s and did NOT restore a backup.

I ran nano /etc/resolv.conf on the RPi Zero and changed it to the .8 IP Address, and all is working now.

I also ran apt update -y && apt upgrade -y with successful results (I was successfully able to update the RPi Zero).

Any ideas as to how this could have happened? Anything else I can run to identify how this came to be?

Indeed. While I did change this via the file directly, I also went into dietpi-config to check the “Static DNS” setting… I found the old .223 IP Address in there. I just don’t understand how or why it was set to the old .223 IP Address.

Previous Setting:

Address : IP = xxx.xxx.xxx.8 | Mask = 255.255.255.0 | Gateway = xxx.xxx.xxx.1 | DNS = xxx.xxx.xxx.223

Updated Settings:

Address : IP = xxx.xxx.xxx.8 | Mask = 255.255.255.0 | Gateway = xxx.xxx.xxx.1 | DNS = xxx.xxx.xxx.8

Either way, thank you both for replying and providing assistance (once again, ha!). I can say that this issue has been SOLVED!

Did you assigned IP address via DHCP first on this device? Probably this way the incorrect DNS server was set.

In generell I recommend to use a global public DNS server on the device running Pihole + Unbound. Why? Because what happen if one of them fail? You will not be able to reinstall them as DNS resolution is not working. Therefore you would need to switch to a public DNS server anyway. :wink:

And usually there is nothing to be blocked on DietPi directly, as there are connections done to apt/software repositories only. At least as long as you don’t have a desktop installed to use a browser :sunglasses:

Now that you mention it, I probably did do that when I set it up since I would have needed the old RPi 4B to continue running Pi-Hole while I installed the fresh copy of OS along with the software needed on the new RPi Zero.

Good point. Just to clarify, I can achieve this via dietpi-config → Network Adapter Settings?

Yup, that makes sense and I figured as much. No GUI on this Pi though, since she really doesn’t have too many resources to spare. :wink:

I can achieve this via dietpi-config → Network Adapter Settings

usually yes, or edit /etc/resolv.conf manually as this will be the leading file at the end

Thanks. I actually did both as we were posting back and forth earlier this morning - just to be sure.

Anyway, all is working! Thanks again for the troubleshooting!