Pi-Hole + Unbound via Wireguard stops working over night

Pi-Hole simply stops working after a some hours. I've tried it without unbound and with unbound. Always the same problem, that my Pi-Hole server cannot find any host anymore.
"curl: (6) Could not resolve host: ifconfig.me"

I've created a debug log but logically i couldn't upload it. Would a mod be so kind and help me out? Where should i upload it?

Thanks!

2 posts were split to a new topic: Pihole+Unbound+Wireguard stops every night

Send it via PM.

[✓] IPv4 address(es) bound to the wg0 interface:

[✗] Failed to resolve mdws.ukrainiancu.com via Pi-hole (XXXXXXXXX)

    DNSMASQ_LISTENING=single
    PIHOLE_DNS_1=1.1.1.1
    PIHOLE_DNS_2=1.0.0.1

You configured your Pi-hole to listen to the wg0 interface only and you are using Cloudflare as upstream DNS.

Does your Pi device have a static public IP address? If your behind a home router, a lot of IPS disconnect clients once in 24 hours and give you a new public IP address. If the public IP of the wg interface change, the wg-clients won't automatically reconnect to the endpoint and need manual reconnection.

The VPS does have a static public IP. EDIT: Although it could be, that Hetzner regularly disconnects clients to renew the IP (which always stays the same?)

A reconnect from the wireguard clients won't work. Rebooting the Wireguard interface neither. I will try to set pihole to listen on all interfaces and see what happens.

I can only access the CLI of the VPS via the Hetzner shell (which is a local network shell). I cannot ssh into the VPS when Pihole isn't working anymore.

I've also used Unbound before this and it did the same thing. I've just selected Cloudflare as DNS in order to rule out Unbound.

When it is not working you got connectivity issues outbound

[i] dig response:  dig: couldn't get address for 'ns1.pi-hole.net': failure
[✗] Distro:  Ubuntu
[✗] Error: Ubuntu is not a supported distro (https://docs.pi-hole.net/main/prerequisites/)


*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] www.informacje-alert24.eu is 0.0.0.0 via localhost (127.0.0.1)
[✓] www.informacje-alert24.eu is 0.0.0.0 via Pi-hole (xxxxxxx)
[✗] Failed to resolve doubleclick.com via a remote, public DNS server (8.8.8.8)

Is there some firewall in place? Something prevents connections to port 53 on the internet.

Also not via IP? This would indicate network connectiviy issues, as DNS would not be involved here.

Actually there is: https://i.imgur.com/851izxr.png
Inbound traffic is restricted to the shown ports.
But all outbound traffic is allowed (on the very bottom it says so)

Nope. SSH onto the IP doesn't work.

Update: It happened again.
pihole -a interface local didn't help.
pihole -a interface all didn't help.

What helped was: service dhcpd restart
After that it immediately worked.

I didn't look up the status of dhcpd when it was not working. I will add it as soon as it happens again.
Any ideas why dhcpd blocks any connection upon a re-release? A Restart does the same but that works just fine...
Status when restarted:

I've noticed that the server was just fine after i've manually restarted the dhcpcd service. It ran for 48 hours without any problems.

Then i tried to restart the server and it happened again. This time i did "service dhcpcd status" and it threw the same errors as it did when the server had internet:

Any ideas why it breaks the internet when it re-releases the adresses automatically?

I've finally managed to solve it on my own, since the support here was kind of lacking.

Nevertheless i wanted to explain how i solved it for others that might have the same issue.

Only do this, if you have a Static public IP
The only thing that was needed was to statically configure the wan interface the dhcpcd.conf file in /etc/.

vi /etc/dhcpcd.conf
Add this to the end of the file:

slaac private
interface eth0 #(yours might be different, basically the wan interface)
        static ip_address=your.static.public.ip.address/32
        static routers=your.gateway
        static domain_name_servers=1.1.1.1 8.8.8.8 #(you can use different DNS Addresses)

How to find out your gateway?
The command ip route will print out your Gateway

default via **your.gateway** dev eth0 proto dhcp src xxx.xxx.xxx metric 100

How to find your WAN interface?
ip -4 -o a (Thanks to samsepi0l)
or
ifconfig (Deprecated)
will print out all of your interfaces. Look for the one which displays your public IP

result of ip -4 -o a :
2: eth0    inet your.public.ip/32 scope global dynamic eth0\  ....
result of ifconfig:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet **your.public.ip**  netmask 255.255.255.255  broadcast 0.0.0.0

Cheers!

Thank you for documenting the solution in the end, but there is no need to be dismissive of our support. We always try to give as much as we ca do and frequently answer questions that go way beyond Pi-hole. Like how you configure port forwarding on particular routers (only guiding by looking at provided screenshots), configuring various Linux settings including but certainly not limited to networking issues.

In the end it turned out that Pi-hole wasn't the problem but something else with your system nobody else seems to have reported before. In the end, everyone in the support "crew" is just a volunteer and other jobs pay our daily life. I'm sorry your issue seems to have slipped through and you haven't received a comment in the last week. However, this is likely just because nobody looking at your issue had any immediate idea what to do next. Your solution still seems to be a workaround and something is still misbehaving in your network.

I fully understand.

I just hoped that there would be somebody who said that the pihole config looks fine just fine.
But instead i just got ghosted.

I don't want to hate. You guys are truly great for what you do.

Just in case for future people, the command will be more ip a (or ip -4 -o a if you want a easier result) to know your WAN interface because ifconfig is depreciated.

Added to the original post.

Thanks!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.