I have an issue I've been trying to solve for a few days now - I'm working on a relatively fresh installation of Ubuntu 18.04, I enabled UFW and configured it with the following rules.
sudo ufw status verbose
Status: active Logging: on (low) Default: deny (incoming), deny (outgoing), disabled (routed)
New profiles: skip
1.1.1.1 53/udp ALLOW OUT Anywhere on < interface >
1.1.1.1 53/tcp ALLOW OUT Anywhere on < interface >
80/tcp ALLOW OUT Anywhere on < interface >
443/tcp ALLOW OUT Anywhere on < interface >
1194/udp ALLOW OUT Anywhere on < interface >
500/tcp ALLOW OUT Anywhere on < interface >
500/udp ALLOW OUT Anywhere on < interface >
4500/udp ALLOW OUT Anywhere on < interface >
8.8.8.8 53/udp ALLOW OUT Anywhere on < interface >
8.8.4.4 53/udp ALLOW OUT Anywhere on < interface >
80/tcp (v6) ALLOW OUT Anywhere (v6) on < interface >
443/tcp (v6) ALLOW OUT Anywhere (v6) on < interface >
1194/udp (v6) ALLOW OUT Anywhere (v6) on < interface >
500/tcp (v6) ALLOW OUT Anywhere (v6) on < interface >
500/udp (v6) ALLOW OUT Anywhere (v6) on < interface >
4500/udp (v6) ALLOW OUT Anywhere (v6) on < interface >
This UFW config seems to work fine, when using 1.1.1.1 or 8.8.8.8 as my DNS ping to the DNS and to domains (usually google.com) both are successful.
After I finished setting up UFW I moved onto installing OpenVPN to connect to ProtonVPN servers - this is when my DNS problem begun.
When the VPN is connected with UFW DISABLED a ping to google.com will resolve and work.
But when the VPN is connected and UFW is ENABLED a ping to google will NOT resolve.
I've tried using 1.1.1.1 and 8.8.8.8 as my DNS and the problem persists with both.
Does anybody have any ideas on what may be going wrong? I beleive the issue lies within my UFW config but I can't see where.