Accessing the PiHole DNS Service over the Wireguard Tunnel not possible?

Viewed 1691

I've started setting up my own VPN Service via WireGuard which works pretty fine with the following ...

Configuration (working)

Client

[Interface]
PrivateKey = *hidden*
Address = 10.6.0.2/24
DNS = 1.1.1.1

[Peer]
PublicKey = *hidden*
PresharedKey = *hidden*
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = vpn.myserver.net:51820

I've set AllowedIPs (IPv4) to 0.0.0.0/0 allowing the Client routing his DNS Request over the Server while preventing a DNS Leak.


My PiHole Service uses the eth0 Interface, while Wireguard uses it's own called wg0.
And the private IPv4 of Pihole (DNS) is 10.0.0.5 and the Server Gateway is 10.0.0.1.

Configuration (not working so far)

Client

[Interface]
PrivateKey = *hidden*
Address = 10.6.0.2/24
DNS = 10.0.0.5

[Peer]
PublicKey = *hidden*
PresharedKey = *hidden*
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = vpn.myserver.net:51820

I appreciate any ideas and tips Posted under this Question, happy commenting :)

1 Answers

For everyone who is reading this in the Future...

I've found the problem and solved the issue.


But first things first, what did I do?

  • I double checked pihole running and working by asking for the DNS IP of Google

    nslookup google.com 10.0.0.5

Which gave me the Output

Server:     10.0.0.5
Address:    10.0.0.5#53

Non-authoritative answer:
Name:   google.de
Address: 216.58.212.163

And here I saw my DNS Address 10.0.0.5#53 and especially noticed the Port 53 which is clearly the Standard DNS Port

  • So I asked myself if this Port is allowed in my ufw (firewall) and ran following command

    sudo ufw status verbose

Which gave me the Output

To                         Action      From
--                         ------      ----
51820/udp                  ALLOW IN    Anywhere
22                         ALLOW IN    Anywhere
51820/udp (v6)             ALLOW IN    Anywhere (v6)
22 (v6)                    ALLOW IN    Anywhere (v6)

Anywhere on eth0           ALLOW FWD   10.6.0.0/24 on wg0

And here I finally saw, that the Port 53 wasn't allowed to be reachable from the outside inside of the network

... lol ...

So I fired up the command sudo ufw allow 53 and after that my WireGuard PiHole DNS started working :)


I hope this was helpfull for anyone addressing the same issue. ~Cheers

Related