So I have successfully set up OpenWRT to tunnel traffic through a PIA vpn. All my devices can connect to the openwrt Lan I set up, and I am able to ping 8.8.8.8 perfectly fine. When I ping google.com or any other traffic fails to resolve the host. I edited the ovpn configuration to add both dhcp-option DNS 10.0.0.241 and 10.0.0.243 as specified by PIA.
I'm at a complete loss on how to resolve this. I should add that when I turn off the VPN, all traffic resolves quickly and immediately. However, my need for this router is to permanently enable the vpn and always use DNS 10.0.0.241 if possible.
The OpenWrt OpenVPN client does not deal with pushed or set DNS servers.
You have to take care of that yourself.
The easiest is if the DNS server are publicly available you then just set those as upstream resolvers, but in your case the DNS servers are only available when the tunnel is up.
There are several scripts which sets the pushed or set DNS servers as exclusive upstream DNS resolvers as the tunnel is up, this is the one I am using:
Readme:
I could kiss you. Thank you so much! I am relatively new to routing network traffic so thank you for your time. Just to confirm, from reading the script it looks like you check the config file and update the resolv config based on what DNS options it finds in the ovpn config?
And this is based on the tunnel being up or down so when I (which will be rare if ever) turn off the vpn it will still provide a functioning DNS provider?