Colleagues, tell me, please, how can I make my OpenVPN client, after establishing a connection with its server, switch the DNS requests to DNS-server that OpenVPN-server specified in the "push" command? And in the event of a shutdown, OpenVPN returned requests to DNS, which reported by DHCP on the WAN interface?
I don't want to write OpenVPN scripts where DNS server addresses are hardcoded. Then it will be very difficult to change this for all clients.
I did not change the DNS and DHСP settings, I use those that the distributive had by default. I remember that a few years ago there was no such problem - everything happened automatically.
Thanks for the link, but it only confused the situation.
As I understand it, the "DNS and domain" section applies to my case.
The file "/etc/hotplug.d/net/00-openvpn-resolv" uses the files "/tmp/resolv.conf.d/resolv.conf.vpn" and "/tmp/resolv.conf.d/resolv.conf .auto".
There is no directory "/tmp/resolv.conf.d/" in my router, and after I created it, nothing began to appear in it. I suppose that either I need to make some additional settings that are not described in the article, or something has changed.