Accessing Unbound DNS on my phone through Wireguard VPN
-
[email protected]replied to [email protected] last edited by
When connected through wireguard can you access anything on the local network?
Also sometimes if you're on an LAN trying to vpn into itself you get weird network issues. Does this issue also happen when you're on another network and vpning back?
Also there's a lot of great videos on YouTube to set this up things like Lawrence systems and network Chuck.
Not exactly sure what the issue is here but gave you the up vote for visability and hopefully someone smarter then me will know.
-
[email protected]replied to [email protected] last edited by
Edit your DNS servers in the wireguard client config file
-
[email protected]replied to [email protected] last edited by
I'm...totally lost here. You're trying to use two different VPNs on your local network? If you want your Unbound device to be a VPN exit node for your network, why wouldn't you just setup routes to make it your default gateway?
Using two different VPM tunnels like this is going to just cause routing issues all over the place if you're already unfamiliar with how to setup the routing to begin with.
-
[email protected]replied to [email protected] last edited by
When connected through wireguard can you access anything on the local network?
Everything works as expected with Wireguard otherwise, I can ssh into my server or my desktop, and access the other things hosted on my server (although these are all through Docker, which is why I suspect container isolation to be an issue).
Does this issue also happen when you're on another network and vpning back?
Yup, same issues whether I'm on the local network, the WiFi at work, or on LTE.
-
[email protected]replied to [email protected] last edited by
I think you misunderstood part of my post, because there's only one VPN tunnel, from the WG client on my phone to the WG server on my laptop.
I want my phone to use the Unbound DNS server, which is hosted locally on the same laptop that runs my Wireguard server.
-
[email protected]replied to [email protected] last edited by
I tried this, as well as manually editing the DNS servers on the client side, but whether I use my host's private local IP or my host's docker interface IP it doesn't seem to work.
-
[email protected]replied to [email protected] last edited by
Ah, okay. If this is Android, just setup your Unbound host IP under 'Private DNS' on your phone then.
Note: this will cause issues once you leave your home network unless your WH tunnel is available from outside. Set the secondary DNS to Mullvad or another secure DNS provider if that's the case and you shouldn't have issues once leaving the house.
-
[email protected]replied to [email protected] last edited by
Android doesn't let me add an IP address under private DNS, it needs to be a domain (like dns.quad9.net rather than 9.9.9.9).
I tried adding a quick DuckDNS domain to my reverse proxy towards port 53, where Unbound is listening. It works, as in I can nslookup using the DuckDNS domain on my desktop (or on my phone when not connected to Wireguard) but if I try to set that domain as my private DNS on Android it says it can't connect.
-
[email protected]replied to [email protected] last edited by
Okay, let me just clarify some stuff here because your language has been confusing.
You're using a "VPN", but on a local network. When you say "VPN", people assume mean you're using a client to a remote location. That's super confusing.
For what you're trying to do you don't even need WG unless you mean to use your DNS server from elsewhere.
Please clarify these two things, but I think you're just complicating a simple setup for an ad blocking DNS server somehow, right?
-
[email protected]replied to [email protected] last edited by
The reason for the VPN is to have access to my Unbound DNS on my phone from anywhere, not only my local network. If I just wanted to configure the DNS on my local network, I'd set up static IP for my network in Android's settings and input the DNS server manually. This works fine when I set it up, but like I said I want to use Unbound on my phone anywhere via Wireguard.
I'm not sure what's the second thing you want me to clarify! Sorry for the confusion, I appreciate you trying to help out
-
[email protected]replied to [email protected] last edited by
So then just open the Unbound server to the internet, assign a hostname to it, and use it. Simple.
-
[email protected]replied to [email protected] last edited by
I could do that, but I want to avoid opening ports on my router's firewall apart from the one necessary for Wireguard. I can access all my other stuff through Wireguard, but I can't wrap my head around why it seemingly can't access Unbound on the local host.
-
[email protected]replied to [email protected] last edited by
Well that's how the Internet works, bud. You're opening a port for WG to start. Either make that work and correct your routing, or find another solution.
You're not going to be stealthy by making this overcomplicated. You're just adding extra steps. You don't want to use DHCP to its benefits locally, and you don't wantbto open ports...what magic do you want to happen here?
-
[email protected]replied to [email protected] last edited by
I'd rather not open ports I don't have to. I don't see why I'd have to open a port when Unbound works on my local network and I have access to my local network via Wireguard. I can access a whole slew of services through that one Wireguard port, why wouldn't Unbound work?
Thanks anyway for trying to help, bud.
-
[email protected]replied to [email protected] last edited by
Well again, that's not how the Internet works.
-
[email protected]replied to [email protected] last edited by
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.
- 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.
- Make sure that the network that your WG connects to has its default DNS setup to be your unbound.
- 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!
I wish you good luck on you self hosting experience!