@Jeremy11one said in DNS stopped working due to route from OpenVPN client:
I noticed that, when my OpenVPN Client connects, it automatically creates an unwanted route that redirects my pfSense's primary DNS server (1.1.1.1) to the OpenVPN interface's IP address (10.10.110.185). I assume this is intended to prevent DNS leaks. But it somehow prevents any of my LAN hosts (or pfSense itself) from pinging 1.1.1.1 or resolving anything.
I never had this problem until a few weeks ago, around the time I updated to pfSense 2.5.2. When it occurs now, I have to remove the route via "route delete 1.1.1.1," then go to DNS Resolver, then click Save and Apply Settings.
Problems:
Disabling the OpenVPN Client does not automatically remove the DNS route it automatically added. Seems like it should.
If a gateway is specified for each DNS server in System > General, pfSense creates routes for them. OpenVPN Client overwrites the route for the first DNS server to apparently force it through the VPN, but when OpenVPN Client is disabled, it does not revert that route back to the correct gateway IP. The route is left pointing to an obsolete IP address.
Rebooting pfSense while the OpenVPN Client is disabled removes the route, but DNS Resolver still does not work until I click "Save" then "Apply Settings." I don't know what "Save" and "Apply Settings" fixes behind the scenes, but it probably shouldn't work like that.
Checking the boxes on the OpenVPN Client page for "Don't pull routes" and "Don't add/remove routes" does not seem to have any effect. Upon connecting to the VPN server, the pfSense VPN Client still automatically creates the routes for the DNS server and the VPN subnet.
How can I prevent my pfSense OpenVPN Client from breaking my DNS Resolver?
I understand this is an older topic, but I have been experiencing the same issue. I am now testing a revised OpenVPN client config with the following options enabled to see if it will stop the behaviour.
[image: 1712081202015-c2ece863-59aa-4f5c-b7ff-caa1568feee3-image.png]
Will report back whether it helps or not. if anyone else has any other suggestion, they are definitely welcome!