Error in NTP client: Cannot resolve NTP server address

Hello All

Consistently experiencing an issue with my NTP server address, the error recurs approximately every 24 hours, displaying the message 'Error in NTP client: Cannot resolve NTP server address: Try again'.

pi@raspberrypi:~ $ pihole-FTL --config ntp
ntp.ipv4.active = true
ntp.ipv4.address =
ntp.ipv6.active = true
ntp.ipv6.address =
ntp.sync.active = true
ntp.sync.server = pool.ntp.org
ntp.sync.interval = 3600
ntp.sync.count = 8
ntp.sync.rtc.set = true
ntp.sync.rtc.device =
ntp.sync.rtc.utc = true
pi@raspberrypi:~ $ pihole -v
Core
Version is v5.18.3-435-gbd99151 (Latest: null)
Branch is development-v6
Hash is bd991510 (Latest: bd991510)
Web
Version is v5.21-921-gc68e05c3 (Latest: null)
Branch is development-v6
Hash is c68e05c3 (Latest: c68e05c3)
FTL
Version is vDev-ee9ca39 (Latest: null)
Branch is development-v6
Hash is ee9ca391 (Latest: ee9ca391)
pi@raspberrypi:~ $ less /etc/services | grep “^ntp”
ntp 123/udp # Network Time Protocol
pi@raspberrypi:~ $ sudo pihole-FTL ntp pool.ntp.org
Using NTP server: pool.ntp.org
........
Received 8/8 valid NTP replies from pool.ntp.org
Time offset: 4.266500e-01 ms (excluded 0 outliers)
Round-trip delay: 9.204030e+00 ms (excluded 0 outliers)

https://tricorder.pi-hole.net/QPAEOw6M/

Any help please, I also think it might affect DNS query, in terms of timing, but not sure, just a side effect.

Thanks in advance.

Does it always happen at the same time? We've had one report in the past where it was exactly happening at 3:01 am for the user in the morning and we traced it down to their Internet modem disconnecting and then reconnecting at exactly this time.

The ntp issue happens anywhere within a 5hr window of the general medium of times this has occurred over time. Both the router and raspberry are both bare bone, I have a 24hr WireGuard VPN connection and there is no issue with the VPN or ntp on the router.
I do however have the router reboot every 24hrs at a certain time in the morning during non uses, for security reason. These ntp popup errors, are either well before the allot time or well after the router reboot by several hours, it seems to be just random in its timing, once per day.
The noticeable issue it seems to have, is getting the IP address of the ntp, do you think by manually adding some IP addresses of the ntp domain in the “local DNS records” could work? It could stabilise the time and give the correct time.

Does you Pi-hole use your itself as DNS server or what is configured? Please check /etc/resolv.conf on your Pi-hole. If your Pi-hole indeed uses itself for name resolution, you should have logging of what is happening at the time the error is logged (check out /var/log/pihole/pihole.log)

Given I don't play around with this file /etc/resolve.conf should there not be a nameserver or something, as it is empty.

All home devices derived their setting from Pihole both static, dhcp and DNS, as for the DD-WRT routers itself, DNS and DHCP are disabled with WireGuard active on DD-WRT.

Still checking the log files, not really sure what you want me to look for.

Most often the DNS server is set via this file. How did you set it?

Whatever you find for pool.ntp.org at the time the warning is recorded. Then, compare it with a successful try and hour before or after to check if there is any obvious difference

I'd started to suspect raspberry OS might be the problem days ago, even though everything seems, fine. However, I checked the logs against the ntp error time, what is strange, is the pi-hole logs showed no errors around the given time but a 30-second gap of nothing. It would seem that for some unknown reason the Raspberry ntp was suffering from some ntp sync issue, so I just reinstalled a fresh OS and reinstalled pihole, all seems well. Thank you for trying to narrow the difficulty.

1 Like

@DL6ER Shouldn't that be /etc/resolv.conf?

1 Like

Yes it should :smiley:
If resolvconf is installed:

$ dpkg -S bin/resolvconf
openresolv: /sbin/resolvconf

It can provide useful information:

$ resolvconf -l
# resolv.conf from eth0.dhcp
# Generated by dhcpcd from eth0.dhcp
domain home.dehakkelaar.nl
search home.dehakkelaar.nl
nameserver 10.0.0.1

EDIT: Might need sudo/root powers!

Oh yes, sure. I blame the spellchecker for this. That's what you get when you do Pi-hole support on the go. Sorry for the glitch - will edit above for future readers.

Sorry, wasn't trying to sound like I was being nitpicky. Just wanted to be sure that if a file name change happened that I needed to be aware of. Your support is very much appreciated and I'm very grateful for it.

Am I to understand that pihole-FTL is going to function as an NTP service with the v6 release?
I haven't tried it yet but I guess this would be advertised as a DHCP option if enabling Pi-hole's own DHCP service?

$ sudo ntpdate -q pi.hole
2024-09-10 22:28:06.845057 (+0200) -0.001898 +/- 0.000300 pi.hole 10.0.0.5 s2 no-leap

I think I found the answer for both questions :smiley:

$ sudo pihole-FTL dhcp-discover
Scanning all your interfaces for DHCP servers
[..]
   ntp-server: 10.0.0.5
   dns-server: 10.0.0.5
   dns-server: 10.0.0.5
   dns-server: 10.0.0.5

Doesnt hurt to have two DHCP services active for a couple of seconds :wink:

Does NTP handle daylight saving time automatically ?

No.
That is covered by your OS's time zone configuration.

Might be helpful to input this info in the help support.

Thanks in advance.