nginx: fix nameservers when they contain DoT domain names

This commit is contained in:
Sandro - 2024-04-29 01:03:57 +02:00
parent a6834d2b05
commit 1aeeba70ad
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,11 @@ in
resolver.addresses =
let
isIPv6 = addr: builtins.match ".*:.*:.*" addr != null;
escapeIPv6 = addr:
escapeIPv6 = entry:
let
# cut off potential domain name from DoT
addr = toString (lib.take 1 (builtins.split "#" entry));
in
if isIPv6 addr then
"[${addr}]"
else