I have set up an OpenVPN client on a travel router to access my home network. In my home network I am using a local DNS server, which I also want to use on my travel router.
My problem is, when the connection to the VPN server is interrupted I can not automatically reconnect because then my local DNS server is not reachable anymore and then the DynDNS entry for my VPN sever does not get resolved.
So I always have to go into the config, use a public DNS server to connect to my VPN and then change back to my DNS server. Alternatively I can use the IP instead of the DynDNS for the time of the travel.
Both options are kind of not optimal, so if anyone has an idea how to improve that would be great
You are right it should be pushed but it is not working with my OpenWRT device. If I e.g. use my mobile OpenVPN app to connect to my OpenVPN server the DNS server is pushed.
I have the according option in the server config push "dhcp-option DNS IPaddress".
When using push there is no dns definition in the client ovpn file? It is also possible to push more than one dns, the second (a public one) serving as a backup and that would prevent blocking. I also vaguely remember that the android client app had a few oddities but I did not test this platform myself. I think it could help to provide the non private part of your server config and dns config but I am not sure I would be capable of helping you further because I was planning on doing almost exactly what you are trying to acheive!
@pavelgl Thank you for the guide, unfortunately it is not working for me. I am still using the ISP DNS server... @papagirafe I added dhcp-option DNS x.x.x.x to the client.conf, unfortunately this did not have any effect...