I think I might have found my problem: Be aware of Android's shady IPv6 DNS
When I check my DNS list for a certain AP on Android, I sometimes can see an IPV6 right on top of my preferred DNS address. For some reason Android likes to sneak it on top turning it into the de-facto main DNS address. Clearing the DNS fields and re-entering them fixes the problem at first but after reconnecting the IPV6 address shows up.
The only workaround I found so far is turning DHCP back on and using an always-on VPN connection so my device is forced to use the same DNS as my docker container. No further wireguard configuration is required. I merely added a DNS option to my wireguard service inside my docker-compose.yml
and set the address to my local host IP (in my case 192.168.1.10
). Now everything works perfectly even when I'm connected to the same network the wireguard server is in.
Some people recommend adding 192.168.1.0/24
(or whatever your subnet is) to the AllowedIPs
of the wireguard peer connection, next to 0.0.0.0/0
in order to allow local IPs resolution and it indeed appears to work but I don't know the implications of such a change. I'll simply keep using the local DNS rule set in pihole to connect to my home server