]> git.ipfire.org Git - thirdparty/openvpn.git/commit
dns: apply settings via script on unixoid systems
authorHeiko Hund <heiko@ist.eigentlich.net>
Wed, 14 May 2025 13:53:27 +0000 (15:53 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 14 May 2025 16:17:51 +0000 (18:17 +0200)
commitfef5c4b4e8d22dd1ffd7271c8f27d7a91ac4f47f
tree8578cd7a6904ee779682c95ceabd0ee64264f9e1
parentad7a6945144bc6d8e3347b8008e5a31d91f23cd4
dns: apply settings via script on unixoid systems

This introduces a new script hook, the dns-updown, and implements such a
command script for a few popular systems (and a default for the not so
popular ones). Like the name suggests this hook is soleley for dealing
with modifying how names are resolved when the VPN pushes some --dns
settings.

The default dns updown command is part of the distribution and is
installed with openvpn. You can change the path the command is located
at as a compile time option, defaults to libexecdir.

You can compile-time disable that the default dns-updown hook is
run by passing --disable-dns-updown-by-default to configure or
ccmake ENABLE_DNS_UPDOWN_BY_DEFAULT to OFF.

There's also a new runtime option --dns-updown, which can run a custom
command, force running the default when disabled or disable execution
of the dns-updown altogether.

Change-Id: Ifbe4ffb44d3bfcaa50adb38cacb3436fcdc71b10
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250514135334.14377-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31639.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
15 files changed:
.gitignore
CMakeLists.txt
config.h.cmake.in
configure.ac
distro/Makefile.am
distro/dns-scripts/Makefile.am [new file with mode: 0644]
distro/dns-scripts/haikuos_file-dns-updown.sh [new file with mode: 0644]
distro/dns-scripts/openresolv-dns-updown.sh [new file with mode: 0644]
distro/dns-scripts/resolvconf_file-dns-updown.sh [new file with mode: 0644]
distro/dns-scripts/systemd-dns-updown.sh [new file with mode: 0644]
doc/man-sections/script-options.rst
src/openvpn/Makefile.am
src/openvpn/dns.c
src/openvpn/dns.h
src/openvpn/options.c