Experimental version. The functionality may undergo significant changes. Compatibility with future versions is not guaranteed.
Why doesn’t automatic DNS server configuration work when connecting to macOS and Linux using the OpenVPN client?
Due to the architectural features of the Linux and macOS operating systems, automatic DNS server configuration when using the official OpenVPN client is not possible.
To configure the DNS server on such operating systems, the service provides the ability to use third-party scripts that run when the client connects or disconnects.
In the client configurations generated by the module, the blocks responsible for these settings are predefined and commented out:
# Uncomment the lines below for use with Linux
#script-security 2
# If you use resolved
#up /etc/openvpn/update-resolv-conf
#down /etc/openvpn/update-resolv-conf
# If you use systemd-resolved, first install the openvpn-systemd-resolved package
#up /etc/openvpn/update-systemd-resolved
#down /etc/openvpn/update-systemd-resolved
To use these code blocks, uncomment them (remove the initial #
symbol), and specify the correct paths to the scripts.
You can either prepare the scripts yourself or use ready-made scripts from the official OpenVPN Community (for Linux). For macOS, you can use a third-party script.
Scripts must have execution permissions.