So I have some services and wireguard running locally on a “home” network. I also have wireguard, a DNS resolver, and a reverse proxy set up on a remote server. Since I don’t want to expose the home IP to the public, to access my services I connect to the VPN on the remote, which then forwards my request home. But this means that when I’m at home, connecting to my local services requires going out to the remote. Is there some way to have the traffic go over the switch when at home, but go over wireguard when away, without having to manually switch the VPN on/off?

I could move the DNS resolver (which handles the internal names for the services) from the remote to the home server. But then similarly every DNS request will need to go through both the remote and home servers, doubling the hops. I’d like to use my own DNS server at all times though, both at and away from home. Which tradeoff seems better?

edit: thanks for all the suggestions, I’ll look into some of these solutions and see what works best

  • motruck@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    3 hours ago

    Are you routing DNS over wireguard the whole time or do the DNS servers change when you go from public internet to your home network?

    If you are using the same DNS servers i.e. always using DNS over wireguard then there isn’t really a lot you can do.

    The way I do this is when I am on my home network I use the DNS on that network, i.e. the adguard instance I set up and also override DNS names with, when I am on some public internet i.e. via cellular, I use whatever DNS server they have. So on home network jellyfin.bob.com returns 192.168.8.3 (for example) and on the public internet jellyfin.bob.com will return 68.32.23.11 (i.e. my public IP address).

    However that requires multiple DNS servers.

    What is an example server where you’d like to do this (it may give us more options) and how is your DNS set up?