• clif@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 days ago

    I want to preface this with the fact that I am definitely NOT a networking expert so… don’t trust anything I say.

    My situation is a bit different because I am using Tailscale, though I have it on the list to be replaced in the future.

    When you Wireguard to your LAN, do subsequent DNS requests go through the VPN? Sounds like you’re looking into that route based on your third point above. If so, can you just add a static DNS resolution to your LAN router that points to your Caddy SSL terminator/reverse proxy? This assumes a static IP for your host.

    That’s what I’ve done. On my router I’ve set a static DNS entry of silverbullet.mydomain.com -> 10.0.0.101 (where *.101 is the static IP of my internal host/Caddy). This allows everything to resolve correctly when I’m physically attached to my LAN but also when connecting remotely via Tailscale.

    It may not be elegant, but it avoids the hassle / extra config of a local DNS server as well as the need to manage host routes on each device.

    EDIT: My router is running OpenWRT but I think most consumer grade routers support static DNS routes… but I could be wrong.

    • hakunawazo@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      My router can’t directly add multiple local DNS routes to one IP address, therefore my attempts with docker container DNS servers.
      Now it works, because I installed bind9 directly on my server, configured my local domains, added the new DNS in router settings, changed my wireguard tunnel that it uses my local DNS first and changed my mobile devices settings that it uses always provided DNS server instead of “privacy” DNS server by the big player.