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

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

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

Post by dwr »

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).
Last edited by dwr on Thu Jun 17, 2021 3:31 am, edited 1 time in total.
dwr - SpicyLimes.io
User avatar
Joulinar
Posts: 5096
Joined: Sat Nov 16, 2019 12:49 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by Joulinar »

Hi,

let's check the DNS server settings on your device

Code: Select all

cat /etc/resolv.conf
readlink -f /etc/resolv.conf
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 340
Joined: Tue Feb 25, 2020 2:54 pm

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by trendy »

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

Code: Select all

dietpi@RockPi:[~]$ sudo apt update
Hit:1 https://deb.debian.org/debian buster InRelease
...
ping -c 3 deb.debian.org
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by dwr »

Joulinar wrote: Wed Jun 16, 2021 9:36 am Hi,

let's check the DNS server settings on your device

Code: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

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

Code: Select all

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...
dwr - SpicyLimes.io
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by dwr »

trendy wrote: Wed Jun 16, 2021 10:12 am Try to run the apt update and then run a ping to the server.
E.g

Code: Select all

dietpi@RockPi:[~]$ sudo apt update
Hit:1 https://deb.debian.org/debian buster InRelease
...
ping -c 3 deb.debian.org
As expected...

Code: Select all

root@DNSPi:~# ping -c 3 deb.debian.org
ping: deb.debian.org: Temporary failure in name resolution
dwr - SpicyLimes.io
User avatar
Joulinar
Posts: 5096
Joined: Sat Nov 16, 2019 12:49 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by Joulinar »

You can change /etc/resolv.conf yourself pointing to correct IP or you use dietpi-config to set correct DNS server
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by dwr »

...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?
dwr - SpicyLimes.io
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by dwr »

Joulinar wrote: Wed Jun 16, 2021 3:52 pm You can change /etc/resolv.conf yourself pointing to correct IP or you use dietpi-config to set correct DNS server
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:

Code: Select all

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

Updated Settings:

Code: Select all

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!
dwr - SpicyLimes.io
User avatar
Joulinar
Posts: 5096
Joined: Sat Nov 16, 2019 12:49 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by Joulinar »

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. ;)

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 8)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
dwr
Posts: 35
Joined: Thu Feb 18, 2021 3:46 am

Re: curl: (28) Resolving timed out after 3000 milliseconds

Post by dwr »

Joulinar wrote: Wed Jun 16, 2021 4:24 pm Did you assigned IP address via DHCP first time on this device? Probably this way the incorrect DNS server was set.
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.
Joulinar wrote: Wed Jun 16, 2021 4:24 pm 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. ;)
Good point. Just to clarify, I can achieve this via dietpi-config -> Network Adapter Settings?
Joulinar wrote: Wed Jun 16, 2021 4:24 pm 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 8)
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. ;)
dwr - SpicyLimes.io
Post Reply