Why doesn’t automatic DNS server configuration work when connecting to macOS and Linux using the OpenVPN client? | Почему не работает автоматическая настройка DNS-сервера при подключении на macOS и Linux с помощью клиента OpenVPN? |
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. | В связи с архитектурными особенностями операционных систем семейства Linux и macOS автоматическая конфигурация DNS-сервера при подключении с помощью официального клиента OpenVPN невозможна. |
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. | Для настройки DNS-сервера в таких ОС сервисом предусмотрена возможность использования сторонних скриптов, которые запускаются при подключении и отключении клиента. |
In the client configurations generated by the module, the blocks responsible for these settings are predefined and commented out: | В клиентских конфигурациях, генерируемых модулем, предопределены и закомментированы блоки, отвечающие за эти настройки: |
bash | bash |
Uncomment the lines below for use with Linux | Uncomment the lines below for use with Linux |
script-security 2 | script-security 2 |
If you use resolved | If you use resolved |
up /etc/openvpn/update-resolv-conf | up /etc/openvpn/update-resolv-conf |
down /etc/openvpn/update-resolv-conf | down /etc/openvpn/update-resolv-conf |
If you use systemd-resolved, first install the openvpn-systemd-resolved package | If you use systemd-resolved, first install the openvpn-systemd-resolved package |
up /etc/openvpn/update-systemd-resolved | up /etc/openvpn/update-systemd-resolved |
down /etc/openvpn/update-systemd-resolved | down /etc/openvpn/update-systemd-resolved |
To use these code blocks, uncomment them (remove the initial | Для активации указанных блоков кода необходимо их раскомментировать (удалить начальный символ |
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. | Скрипты можно подготовить самостоятельно или воспользоваться готовыми решениями от официального OpenVPN Community (для Linux). Для macOS можно воспользоваться сторонним скриптом. |
Scripts must have execution permissions. | Скрипты должны обладать правами на исполнение. |