Starting back up Pi-hole + Unbound - RTC

I have two Odroid HC1 running Pi-hole, as installed with the DietPi script.

They just sat through a 2.5 day power outage. Coming back up, they WOULD NOT start pulling dns again.

  • everything was set up with static IPs, so I could access things.
  • date on the Odroids gave a timestamp two days old

I came up with a solution;

Pi-hole >> Settings >> DNS >> Upstream DNS Servers
Change from Custom 1/ 127.0.0.1#5335 to anything external
and reboot
then change it back once it was confirmed NTP had updated the time.

I assume the problem is that the NTP time server was specified with a domain, which meant the DNS server (unbound?) refused to do anything since time stamps were so off - including giving a valid ip for a time server to sync with.

Is there any way to automatically resolve this chicken-and-egg scenario? I assume it would be, like, caching some NTP IPs in /etc/hosts on a regular basis

I guess you set PiHole as upstream DNS server inside DietPi local network configuration? Can you check

cat /etc/resolv.conf

I always recommend to use a global public upstream DNS within DietPi local network configuration to avoid situations like this.

root@ODROID-███████:~# cat /etc/resolv.conf
domain f███████.net
search f███████.net
nameserver 192.168.2.63
nameserver 192.168.2.64

Same for both. And yes, those are the static IPs I assigned.

So, just add a

nameserver 8.8.8.8

at the end?

just remove your local DNS servers and use global public DNS only. There is no need for them.

A few workarounds:

  1. Use a local ntp which can work with local dns
  2. Use IPs for ntp servers
  3. Disable DNSSEC for some ntp servers.