This topic has come up a lot this past week. There are two settings that affect how DNS is handled by the OpenVPN Client -
Accept DNS Configuration and
Redirect Internet Traffic.
In the OpenVPN Client, if you set
Accept DNS Configuration = Exclusive and use
Policy Rules or
Policy Rules (Strict), dnsmasq will be bypassed and the OPenVPN Client will "exclusively" use the DNS of the VPN Provider. The Diversion ad blocker written by
@thelonelycoder will not work with this configuration as Diversion requires dnsmasq to work. Diversion will work if you set
Redirect Internet Traffic to
All.
If you want the OpenVPN client to use dnsmasq + Diversion, there are two options available to resolve the DNS and routing issues when using Policy Rules with Asuswrt-Merlin:
- Set Accept DNS Configuration to “Strict” and specify the DNS server for the VPN tunnel to use by adding the dhcp-option DNS command in the Custom Configuration section. Without the dhcp-option command, Diversion updates will fail, the Diversion email function will no longer work and the wget command will not able to resolve the domain name.
- My preferred recommendation is to install Stubby DNS over TLS. Stubby will encrypt DNS queries. To enable the OpenVPN Client to use Stubby, set Accept DNS Configuration to “Disabled”.
The
definition of the
Accept DNS Configuration field values are as follows:
- Disabled: DNS servers pushed by VPN provided DNS server are ignored.
- Relaxed: DNS servers pushed by VPN provided DNS server are prepended to the current list of DNS servers, of which any can be used.
- Strict: DNS servers pushed by the VPN provided DNS server are prepended to the current list of DNS servers, which are used in order (existing DNS servers are only used if VPN provided ones don’t respond).
- Exclusive: Only the pushed VPN provided DNS servers are used.