This is my first post, so hopefully I am doing it right. I am still a complete noob at Raspberry Pis, so bear with me here...
Here is the story. I followed these tutorials on creating a WiFi hotspot, then a VPN router on a Raspberry Pi 3.
WiFi hotspot tutorial: https://pimylifeup.com/raspberry-pi-wireless-access-point/
VPN router tutorial: https://pimylifeup.com/raspberry-pi-vpn-access-point/
Everything works, except there are DNS leaks. I followed the steps very carefully and even reinstalled Raspbian multiple times. On my final reinstall, I compared it to the original Raspbian guide: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md
There are still DNS leaks on all devices that connect to the VPN router. This did not used to happen. However, ever since it began happening, it has kept happening ever since.
Other troubleshooting steps I have tried:
- Edit /etc/resolv.conf on the router to only allow the VPN provider's DNS servers (does not work)
- Edit /etc/resolv.conf on a client (temporary fix, lost on reboot and only affects 1 host)
- Added:
script-security 2
up /etc/openvpn/update-resolv-conf.sh
down /etc/openvpn/update-resolv-conf.sh
to the VPN config file (works only intermittently). openvpn-update-resolv-conf was already installed by default (https://github.com/alfredopalhares/openvpn-update-resolv-conf)
Is there any permanent fix to only allow the VPN provider's DNS servers to resolve hostnames and block all ISP attempts at DNS resolution?
This is the closest thing I could find, but it also did not help: https://community.openvpn.net/openvpn/wiki/Pushing-DNS-to-clients
Thank you for your time, and if you need any more information just let me know.
block-outside-dns
(see this post) but there is a chance that the client will not enforce certain settings pushed by the VPN server. The behavior can be OS-dependent (Windows & Linux) and also network interface-dependent. What happens if the VPN connection drops due to a network issue ? I could imagine that the client restores default settings, and the leaks happen.