I start openvpn service and when i connect to the server, i bash these commands:
sudo iptables -A INPUT -j DROP'
sudo iptables -A OUTPUT -j DROP
sudo iptables -A OUTPUT -o tun0 -j ACCEPT
read -p "PRESS ANY KEY TO STOP" VAR //just for easily reversing the drops when i want without bashing another file
sudo iptables -I INPUT -j ACCEPT
sudo iptables -I OUTPUT -j ACCEPT
When i test the vpn to https://ipleak.net/ , there are no leaks. But when i try on this https://www.dnsleaktest.com/, there are several leaks.
I captured with wireshark all request and replies and i see dns requests to port 53 and then dns responses. I tried with iptables to block outgoing to port 53 but still dns queries are happening.. I have also added the security script 2 to the vpn file to update resolv conf and disabled the ip6.
What should i do to prevent dns leaks with iptables or even ufw?