From f20848fda7b19f5f7023bcbfe0ab9c6e8c6f8307 Mon Sep 17 00:00:00 2001
From: Vladimir Dubrovin <3proxy@3proxy.ru>
Date: Wed, 16 Sep 2026 15:04:08 +0300
Subject: [PATCH] Document that an IPv6 nserver address needs square brackets
nserver and authnserver parse their argument with parsehost(), which reads
the first colon as the address/port separator, so a bare IPv6 address picks
up a bogus port number. Document the bracket form in 3proxy.cfg(5) and in
both HOWTOs.
Refs #1275, #460
Co-Authored-By: Claude Opus 5
nserver 192.168.1.2
- nserver 192.168.1.3:5353/tcp
+ nserver 192.168.1.3:5353/tcp
+ nserver [2001:4860:4860::8844]
sets DNS resolvers. 192.168.1.3 will be used via TCP/5353 (instead of default UDP/53)
only if 192.168.1.2 fails. Up to 5 nservers may be specified.
If no nserver is configured, default system name resolution functions are used.
+ An IPv6 address has to be written in square brackets.
nscache 65535
nscache6 65535
diff --git a/doc/html/howtor.html b/doc/html/howtor.html
index 723d299..238cd3a 100644
--- a/doc/html/howtor.html
+++ b/doc/html/howtor.html
@@ -1993,11 +1993,13 @@ socks -p1080
nscache и nsrecord.
nserver 192.168.1.2
- nserver 192.168.1.3:5353/tcp
+ nserver 192.168.1.3:5353/tcp
+ nserver [2001:4860:4860::8844]
указывает 3proxy какие машины следует использвоать в качестве серверов
DNS. Сервер 192.168.1.3 будет использоваться по порту TCP/5353 (вместо дефолтного UDP/53) только при недостижимости
192.168.1.2. Можно указать до 5 серверов. Если nserver не указан, будут
использованы системные функции разрешения имен.
+ Адрес IPv6 необходимо записывать в квадратных скобках.
nscache 65535
nscache6 65535
diff --git a/doc/html/man5/3proxy.cfg.5.html b/doc/html/man5/3proxy.cfg.5.html
index f84c17f..59c4109 100644
--- a/doc/html/man5/3proxy.cfg.5.html
+++ b/doc/html/man5/3proxy.cfg.5.html
@@ -482,7 +482,11 @@ experimental.
authnserver diff --git a/man/3proxy.cfg.5 b/man/3proxy.cfg.5 index fc2e38c..bb31f6d 100644 --- a/man/3proxy.cfg.5 +++ b/man/3proxy.cfg.5 @@ -517,6 +517,13 @@ system routines for name resolution is used. Optional port number may be specified. If optional /tcp is added to IP address, name resolution is performed over TCP. +An IPv6 address has to be enclosed in square brackets: +.br + \fBnserver 1.1.1.1\fR +.br + \fBnserver [2001:4860:4860::8844]\fR +.br + \fBnserver [2001:4860:4860::8844]:5353/tcp\fR .br .BR authnserver