1

What I am trying to accomplish:

I have a WireGuard reverse VPN Setup that does not route my traffic, but lets me connect to my raspberry pi from within the Internet using a public server as "bridge".

I installed pihole on the raspberry pi. Now, I want to use the pi as DNS (over WireGuard) while sending the actual HTTP request from my actual device.

What I've tried:

Obviously, I have tried to enter the pi's VPN-IP into NetworkManager. This has given me some headache as my Ubuntu (5.4.0-42-generic #46~18.04.1-Ubuntu) was always falling back to its default DNS (what I did not want even if the VPN DNS worked). I found a workaround provided by user2427436 on a SO thread here.

What the issue is:

While I can force the DNS to use (without falling back to the routers/default DNS), I cannot manage to use the pihole as DNS. I can connect to the pi via tunnel (eg HTTP, SSH,..), and the Port 53 (for DNS) is opened in the firewall. I still cannot resolve any domainnames. Also, checking journalctl -xe on the pi does not show any hint that the device tried to connect/resolve.

I would really like to understand why this is not working and how it is supposed to work. I feel like I am missing something on how DNS works.

What would be the correct logfile to check here? Do you have any suggestions what I should try next?

EDIT:

DNS is setup per network device. Does my wlan0 device @192.168.0.0\24 know about the wg0 device and it's address space @192.168.66.0\24? May this be the cause of the problem, that I try to resolve a request from wlan0 using a DNS over wg0? If yes, how would I solve this?

FedKad
  • 10,515
randmin
  • 211

1 Answers1

0

6 month passed, and as there is no answer, I will try and explain what I've found out. First off: It is working. It is perfectly fine to resolve DNS over one interface, and then send the actual request over another.

I cannot tell exactly what the problem was, but it was solved when I added a line with DNS = .... to the wireguard configuration, instead of setting the DNS on the wlan-device. Intuitively, that makes less sense to me, however it is working now and I am happy that it is! ;)

randmin
  • 211