I just setup Unbound DNS on my home server (read: old laptop screaming for dear life next to my router). Everything is working well, I can access it and use it as my DNS server on my desktop which is connected to the same network as my server.

The issue is with trying to get my phone to use Unbound while connected to the same laptop through Wireguard. If I’m connected to the Wi-Fi and disconnected from Wireguard, I can nslookup on my phone using the Unbound server, but as soon as I’m connected through Wireguard it can’t access the DNS server.

I suspect it has something to do with the fact that I run Wireguard through Docker but Unbound is setup directly on the host machine, and the container isolation is what’s causing my issues. However, I tried adding

extra_hosts:
    - "host.docker.internal:host-gateway"

to my docker-compose.yml for Wireguard, and tried accessing the DNS using the host IP inside the docker interface, but it didn’t work.

Does anyone have any leads or tips on how to properly configure this? Thanks in advance!

  • rymdlord@feddit.nu
    link
    fedilink
    English
    arrow-up
    0
    ·
    22 hours ago

    If I don’t remember wrong Android will always use your DNS config over the WG provided one so make sure to leave it blank. As for the routing I have a alternative solution that could maybe work using this app in combination with the WG tunnel. But when it comes to your current setup I suggest you try the following.

    1. Make sure that the IP and port of your DNS are accessible from your Phone you can use Termux if you want to ping and do a nc to do this.
    2. Make sure that the network that your WG connects to has its default DNS setup to be your unbound.
    3. Consider getting a Router that can run OpenWRT and then learn about vlans to create two networks(also 2 wifis) one for your roomates and one for you. Also you could setup WG on the OpenWRT router itself!

    If you really want to solve this problem you might want to read up on routing and networking in general! I suggest you start with Wikipedia! That’s atleast where I started! :D

    I wish you good luck on you self hosting experience!