Repository navigation
Accessing a local mail server with the tunnel disabled #1442
|
Hi everyone, At home, I run a FritzBox as well as a Raspberry Pi hosting WireGuard and a mail server. I’ve added my domain to the FritzBox’s DNS rebind protection list—meaning that DNS responses pointing to IP addresses within my home network are blocked. However, for the past few versions of WG Tunnel, I’ve only been able to retrieve emails on my mobile phone while connected to the home network if the WireGuard tunnel is active. As soon as I turn the tunnel off (or it’s automatically disabled via AutoTunnel), it stops working—no emails are retrieved. Does anyone here happen to have an idea what I might be doing wrong? Thanks in advance, Andreas |
Replies: 1 comment 3 replies
|
The shape of this is worth noticing: the tunnel is not breaking anything, it is supplying something that goes missing when it drops. What it supplies is DNS. While the tunnel is up your phone resolves through the WireGuard-provided resolver on the Pi, which answers with the internal address. As soon as it comes down, resolution falls back to the Wi-Fi's DNS — the FritzBox — and that is where it stops working. There are two ways the FritzBox can produce that, and they need different fixes, so it is worth finding out which one you have. Either the rebind protection is still catching the name and you get nothing back, or it resolves to your public IP and the connection then fails because the FritzBox will not loop a LAN client back to its own WAN address. You can tell them apart in one step. On the phone, on home Wi-Fi with the tunnel off, resolve the mail hostname and look at the answer:
For the second case the tidiest answer is usually to have the Pi's resolver serve that name to LAN clients too, and hand it out via DHCP, so the answer is the same whether or not the tunnel happens to be up. |
The shape of this is worth noticing: the tunnel is not breaking anything, it is supplying something that goes missing when it drops. What it supplies is DNS. While the tunnel is up your phone resolves through the WireGuard-provided resolver on the Pi, which answers with the internal address. As soon as it comes down, resolution falls back to the Wi-Fi's DNS — the FritzBox — and that is where it stops working.
There are two ways the FritzBox can produce that, and they need different fixes, so it is worth finding out which one you have. Either the rebind protection is still catching the name and you get nothing back, or it resolves to your public IP and the connection then fails because the…