Pi-hole stops working after power outage or restart

I dig up this conversation because I had the same issue with a newly installed pi-hole.

I turn off all devices at night, included the pi. So the pi-hole need to restart correctly each day. After one week trying, I finally succeeded! It's a dirty solution but it work, maybe some of you will find something more clean.

For me, pi-hole can't work as a DNS server when restarted because he don't have the right time.
So :
1/ I installed ntp on the Pi.
2/ I forced "nameserver 8.8.8.8" on /etc/resolv.conf
3/ I change the right of this file to 555 to avoid system modification each time.

After each start, the pi need a bit of time to sync with ntp server but after that, all good to go.

1 Like

1/ I installed ntp on the Pi.
2/ I forced “nameserver 8.8.8.8” on /etc/resolv.conf
3/ I change the right of this file to 555 to avoid system modification each time.

Thanks! I had the same problem and this fixed it.

1 Like

This is true only for the Pi itself. Other clients will continue to use the Pi-Hole as DNS.

1 Like

You can change it back to 127.0.0.1 after ntp setup if you want. but ntp to be installed and configured, I needed to change the DNS to 8.8.8.8

A post was split to a new topic: Pi-hole not running after reboot

This has got to be the stupidest thing ever. So time goes off and internet doesn't work.
You cannot manually set the time. You cannot edit the file for the name server. You cannot install NTP.

Last time power went out the only solution was to wipe the pi and install it again.

Pi-hole since version 5.0 (May 2020) no longer changes the nameserver assigned to the Pi-hole host device.

https://pi-hole.net/2020/05/10/pi-hole-v5-0-is-here/#page-content

If your Pi-hole host is using Pi-hole as nameserver, you change this in the OS and the host will have access to a DNS server whether Pi-hole is operating or not.

after the 6th time of setting the time it finally worked. Hopefully with just the install of NTP is enough to not have this issue again.

A post was split to a new topic: Pi-hole not working