]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Document --preresolve option
authorSami Rusani <samgithub@pm.me>
Sat, 27 Jun 2026 19:03:51 +0000 (21:03 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 30 Jun 2026 06:58:37 +0000 (08:58 +0200)
The option resolves configured remote, local, and proxy hostnames at
startup and reuses those resolved addresses on reconnects.

Document it in the usage text and client options man page, including
the reconnect trade-off for configurations that rely on changing DNS
answers.

GitHub: fixes OpenVPN/openvpn#532
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <_5bQ5LvkEmn_vaE7Ng8xPAcHJFWfy7td0Yvim0iLc3YVoer2RM1-PoBKAGPzHZKx1rsZP7Ht7kM_2eIUSidNkMW34yS7eT549_fSvcb-dl0=@pm.me>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37387.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/man-sections/client-options.rst
src/openvpn/options.c

index 3ad91043fee202d279430a0918851a3e0fccf611..87c138a5c8d55f81a513b2cfaf79af74c063e092 100644 (file)
@@ -568,6 +568,17 @@ configuration.
   By default, ``--resolv-retry infinite`` is enabled. You can disable by
   setting n=0.
 
+--preresolve
+  Resolve configured ``--remote``, ``--local``, ``--http-proxy``, and
+  ``--socks-proxy`` hostnames at startup before opening the connection.
+
+  The resolved addresses are cached and reused for reconnects, so OpenVPN
+  will not re-resolve these hostnames after the initial connection attempt.
+  This can help configurations where DNS is unavailable while the VPN is
+  down, but can be counter-productive for dynamic DNS names or when roaming
+  between networks where address family availability changes, such as
+  DNS64/NAT64.
+
 --single-session
   After initially connecting to a remote peer, disallow any new
   connections. Using this option means that a remote peer cannot connect,
index f4140242254cd33da405ce66b9ec606051113fad..87218d47da18ebbabae2ab6e6c1d9660b2e7d5c3 100644 (file)
@@ -175,6 +175,7 @@ static const char usage_message[] =
     "--resolv-retry n: If hostname resolve fails for --remote, retry\n"
     "                  resolve for n seconds before failing (disabled by default).\n"
     "                  Set n=\"infinite\" to retry indefinitely.\n"
+    "--preresolve    : Resolve configured --remote, --local, and proxy hostnames at startup.\n"
     "--float         : Allow remote to change its IP address/port, such as through\n"
     "                  DHCP (this is the default if --remote is not used).\n"
     "--ipchange cmd  : Run command cmd on remote ip address initial\n"