From: Nicki Křížek Date: Thu, 23 Jul 2026 16:31:01 +0000 (+0000) Subject: Set the listening port through the options-level port statement X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b23244ed7092af8113a13a06b1414a82cfad59fc;p=thirdparty%2Fbind9.git Set the listening port through the options-level port statement Some instances configured the assigned port only as a listen-on qualifier. Where the file had no options-level port at all, that also left named's default destination port for queries, notifies, and transfers at 53 — on the test network every instance runs on the assigned port, so this only worked for setups that never needed to reach another instance. Set `port @PORT@;` at options level and use plain listen-on statements; files with a deliberate non-standard port statement (dns64's and notify/ns4's dual-port setups) are skipped. Assisted-by: Claude:claude-fable-5 --- diff --git a/bin/tests/system/ede24/ns1/named.conf.j2 b/bin/tests/system/ede24/ns1/named.conf.j2 index a4e69dc453e..7b530d3174e 100644 --- a/bin/tests/system/ede24/ns1/named.conf.j2 +++ b/bin/tests/system/ede24/ns1/named.conf.j2 @@ -1,6 +1,7 @@ options { + port @PORT@; query-source address 10.53.0.1; - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; transfer-source 10.53.0.1; pid-file "named.pid"; recursion no; diff --git a/bin/tests/system/ede24/ns2/named.conf.j2 b/bin/tests/system/ede24/ns2/named.conf.j2 index 36801526515..ad1fac2f654 100644 --- a/bin/tests/system/ede24/ns2/named.conf.j2 +++ b/bin/tests/system/ede24/ns2/named.conf.j2 @@ -1,7 +1,8 @@ options { + port @PORT@; query-source address 10.53.0.2; notify-source 10.53.0.2; - listen-on port @PORT@ { 10.53.0.2; }; + listen-on { 10.53.0.2; }; transfer-source 10.53.0.2; pid-file "named.pid"; recursion no; diff --git a/bin/tests/system/masterformat/ns1/named.conf.j2 b/bin/tests/system/masterformat/ns1/named.conf.j2 index 5ff1ecf4002..3d4f4538af2 100644 --- a/bin/tests/system/masterformat/ns1/named.conf.j2 +++ b/bin/tests/system/masterformat/ns1/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; port @PORT@; listen-on-v6 { none; }; recursion no; diff --git a/bin/tests/system/masterformat/ns2/named.conf.j2 b/bin/tests/system/masterformat/ns2/named.conf.j2 index 65b81e6ac63..5f35b8c58af 100644 --- a/bin/tests/system/masterformat/ns2/named.conf.j2 +++ b/bin/tests/system/masterformat/ns2/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.2; transfer-source 10.53.0.2; pid-file "named.pid"; - listen-on port @PORT@ { 10.53.0.2; }; + listen-on { 10.53.0.2; }; listen-on-v6 { none; }; port @PORT@; recursion no; diff --git a/bin/tests/system/masterformat/ns3/named.conf.j2 b/bin/tests/system/masterformat/ns3/named.conf.j2 index be8d5f97127..77ab423e7dc 100644 --- a/bin/tests/system/masterformat/ns3/named.conf.j2 +++ b/bin/tests/system/masterformat/ns3/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.3; transfer-source 10.53.0.3; pid-file "named.pid"; - listen-on port @PORT@ { 10.53.0.3; }; + listen-on { 10.53.0.3; }; port @PORT@; listen-on-v6 { none; }; recursion no; diff --git a/bin/tests/system/masterformat/ns4/named.conf.j2 b/bin/tests/system/masterformat/ns4/named.conf.j2 index 7f600e964b9..f10a44f90e2 100644 --- a/bin/tests/system/masterformat/ns4/named.conf.j2 +++ b/bin/tests/system/masterformat/ns4/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.4; transfer-source 10.53.0.4; pid-file "named.pid"; - listen-on port @PORT@ { 10.53.0.4; }; + listen-on { 10.53.0.4; }; port @PORT@; listen-on-v6 { none; }; recursion no; diff --git a/bin/tests/system/masterformat/ns4/named2.conf.j2 b/bin/tests/system/masterformat/ns4/named2.conf.j2 index 2d51f97dd0b..8c41db2db99 100644 --- a/bin/tests/system/masterformat/ns4/named2.conf.j2 +++ b/bin/tests/system/masterformat/ns4/named2.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.4; transfer-source 10.53.0.4; pid-file "named.pid"; - listen-on port @PORT@ { 10.53.0.4; }; + listen-on { 10.53.0.4; }; port @PORT@; listen-on-v6 { none; }; recursion no; diff --git a/bin/tests/system/proxy/ns1/named.conf.j2 b/bin/tests/system/proxy/ns1/named.conf.j2 index 6191e484800..3a7464d559d 100644 --- a/bin/tests/system/proxy/ns1/named.conf.j2 +++ b/bin/tests/system/proxy/ns1/named.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic test - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; listen-on port @EXTRAPORT1@ proxy plain { 10.53.0.1; }; listen-on port @EXTRAPORT1@ proxy plain { 10.53.0.2; }; diff --git a/bin/tests/system/proxy/ns3/named.conf.j2 b/bin/tests/system/proxy/ns3/named.conf.j2 index d9b38ad7112..c8a40314ef3 100644 --- a/bin/tests/system/proxy/ns3/named.conf.j2 +++ b/bin/tests/system/proxy/ns3/named.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.3; notify-source 10.53.0.3; transfer-source 10.53.0.3; pid-file "named.pid"; ## # generic test - listen-on port @PORT@ { 10.53.0.3; }; + listen-on { 10.53.0.3; }; listen-on port @EXTRAPORT1@ proxy plain { 10.53.0.3; }; listen-on port @TLSPORT@ proxy encrypted tls self-signed { 10.53.0.3; }; diff --git a/bin/tests/system/redirect/ns10/named.conf.j2 b/bin/tests/system/redirect/ns10/named.conf.j2 index 029d7acfc09..d33395ae883 100644 --- a/bin/tests/system/redirect/ns10/named.conf.j2 +++ b/bin/tests/system/redirect/ns10/named.conf.j2 @@ -7,7 +7,7 @@ options { notify-source 10.53.0.10; transfer-source 10.53.0.10; port @PORT@; - listen-on port @PORT@ { 10.53.0.10; }; + listen-on { 10.53.0.10; }; pid-file "named.pid"; nxdomain-redirect redirect; dnssec-validation yes; diff --git a/bin/tests/system/redirect/ns5/named.conf.j2 b/bin/tests/system/redirect/ns5/named.conf.j2 index 7f101097f47..60b7a17f49a 100644 --- a/bin/tests/system/redirect/ns5/named.conf.j2 +++ b/bin/tests/system/redirect/ns5/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.5; transfer-source 10.53.0.5; port @PORT@; - listen-on port @PORT@ { 10.53.0.5; }; + listen-on { 10.53.0.5; }; pid-file "named.pid"; nxdomain-redirect signed; dnssec-validation no; diff --git a/bin/tests/system/redirect/ns6/named.conf.j2 b/bin/tests/system/redirect/ns6/named.conf.j2 index 539f4b332b0..7f99d5567de 100644 --- a/bin/tests/system/redirect/ns6/named.conf.j2 +++ b/bin/tests/system/redirect/ns6/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.6; transfer-source 10.53.0.6; port @PORT@; - listen-on port @PORT@ { 10.53.0.6; }; + listen-on { 10.53.0.6; }; pid-file "named.pid"; nxdomain-redirect unsigned; dnssec-validation no; diff --git a/bin/tests/system/redirect/ns7/named.conf.j2 b/bin/tests/system/redirect/ns7/named.conf.j2 index f0f7c1cc474..46af5b6bd02 100644 --- a/bin/tests/system/redirect/ns7/named.conf.j2 +++ b/bin/tests/system/redirect/ns7/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.7; transfer-source 10.53.0.7; port @PORT@; - listen-on port @PORT@ { 10.53.0.7; }; + listen-on { 10.53.0.7; }; pid-file "named.pid"; nxdomain-redirect redirect; dnssec-validation no; diff --git a/bin/tests/system/redirect/ns8/named.conf.j2 b/bin/tests/system/redirect/ns8/named.conf.j2 index 0b8939aa873..3ba4abf8042 100644 --- a/bin/tests/system/redirect/ns8/named.conf.j2 +++ b/bin/tests/system/redirect/ns8/named.conf.j2 @@ -5,7 +5,7 @@ options { notify-source 10.53.0.8; transfer-source 10.53.0.8; port @PORT@; - listen-on port @PORT@ { 10.53.0.8; }; + listen-on { 10.53.0.8; }; pid-file "named.pid"; nxdomain-redirect redirect; dnssec-validation no; diff --git a/bin/tests/system/redirect/ns9/named.conf.j2 b/bin/tests/system/redirect/ns9/named.conf.j2 index 8f5f038d246..0488abce1a9 100644 --- a/bin/tests/system/redirect/ns9/named.conf.j2 +++ b/bin/tests/system/redirect/ns9/named.conf.j2 @@ -6,7 +6,7 @@ options { notify-source 10.53.0.9; transfer-source 10.53.0.9; port @PORT@; - listen-on port @PORT@ { 10.53.0.9; }; + listen-on { 10.53.0.9; }; pid-file "named.pid"; dnssec-validation no; recursion no; diff --git a/bin/tests/system/transport_acl/ns1/named.conf.j2 b/bin/tests/system/transport_acl/ns1/named.conf.j2 index 7d849e99a33..ffc083e2c89 100644 --- a/bin/tests/system/transport_acl/ns1/named.conf.j2 +++ b/bin/tests/system/transport_acl/ns1/named.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic test - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; listen-on port @TLSPORT@ tls self-signed { 10.53.0.1; }; # test #1 listen-on port @EXTRAPORT1@ { 10.53.0.1; }; diff --git a/bin/tests/system/transport_change/ns1/named-http-plain-proxy.conf.j2 b/bin/tests/system/transport_change/ns1/named-http-plain-proxy.conf.j2 index 4e6d9cc7e88..b9481dd72c8 100644 --- a/bin/tests/system/transport_change/ns1/named-http-plain-proxy.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-http-plain-proxy.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ proxy plain tls none http default { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy plain tls none http default { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-http-plain.conf.j2 b/bin/tests/system/transport_change/ns1/named-http-plain.conf.j2 index fd8037cc8bc..bdd30572642 100644 --- a/bin/tests/system/transport_change/ns1/named-http-plain.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-http-plain.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ tls none http default { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ tls none http default { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-https-proxy-encrypted.conf.j2 b/bin/tests/system/transport_change/ns1/named-https-proxy-encrypted.conf.j2 index 2a3e1bf4940..fb0bfba7eb0 100644 --- a/bin/tests/system/transport_change/ns1/named-https-proxy-encrypted.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-https-proxy-encrypted.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ proxy encrypted tls self-signed http default { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy encrypted tls self-signed http default { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-https-proxy-plain.conf.j2 b/bin/tests/system/transport_change/ns1/named-https-proxy-plain.conf.j2 index c0a87c6d92e..a6cb487c537 100644 --- a/bin/tests/system/transport_change/ns1/named-https-proxy-plain.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-https-proxy-plain.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ proxy plain tls self-signed http default { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy plain tls self-signed http default { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-https.conf.j2 b/bin/tests/system/transport_change/ns1/named-https.conf.j2 index 0714ea7a9da..249e8cbdb86 100644 --- a/bin/tests/system/transport_change/ns1/named-https.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-https.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ tls self-signed http default { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ tls self-signed http default { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-proxy.conf.j2 b/bin/tests/system/transport_change/ns1/named-proxy.conf.j2 index aaccae2fcbd..e3ea33fa297 100644 --- a/bin/tests/system/transport_change/ns1/named-proxy.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-proxy.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test listen-on port @EXTRAPORT1@ proxy plain { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy plain { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-tls-proxy-encrypted.conf.j2 b/bin/tests/system/transport_change/ns1/named-tls-proxy-encrypted.conf.j2 index 5f48b865d0d..eba0d795c77 100644 --- a/bin/tests/system/transport_change/ns1/named-tls-proxy-encrypted.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-tls-proxy-encrypted.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ proxy encrypted tls self-signed { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy encrypted tls self-signed { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-tls-proxy-plain.conf.j2 b/bin/tests/system/transport_change/ns1/named-tls-proxy-plain.conf.j2 index 6e44d99de4a..453bb9a1bb8 100644 --- a/bin/tests/system/transport_change/ns1/named-tls-proxy-plain.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-tls-proxy-plain.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ proxy plain tls self-signed { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ proxy plain tls self-signed { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named-tls.conf.j2 b/bin/tests/system/transport_change/ns1/named-tls.conf.j2 index 1152598f0fe..3a798385526 100644 --- a/bin/tests/system/transport_change/ns1/named-tls.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named-tls.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test TLS listen-on port @EXTRAPORT1@ tls self-signed { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ tls self-signed { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/transport_change/ns1/named.conf.j2 b/bin/tests/system/transport_change/ns1/named.conf.j2 index 42b94f67851..943596faba1 100644 --- a/bin/tests/system/transport_change/ns1/named.conf.j2 +++ b/bin/tests/system/transport_change/ns1/named.conf.j2 @@ -6,13 +6,14 @@ tls self-signed { }; options { + port @PORT@; query-source address 10.53.0.1; notify-source 10.53.0.1; transfer-source 10.53.0.1; pid-file "named.pid"; ## # generic - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; # test listen-on port @EXTRAPORT1@ { 10.53.0.1; }; listen-on-v6 port @EXTRAPORT1@ { fd92:7065:b8e:ffff::1; }; diff --git a/bin/tests/system/xfer_servers_list/ns1/named.conf.j2 b/bin/tests/system/xfer_servers_list/ns1/named.conf.j2 index 223e0e6f1b7..4f1dbdc372d 100644 --- a/bin/tests/system/xfer_servers_list/ns1/named.conf.j2 +++ b/bin/tests/system/xfer_servers_list/ns1/named.conf.j2 @@ -1,6 +1,7 @@ options { + port @PORT@; query-source address 10.53.0.1; - listen-on port @PORT@ { 10.53.0.1; }; + listen-on { 10.53.0.1; }; transfer-source 10.53.0.1; pid-file "named.pid"; recursion no; diff --git a/bin/tests/system/xfer_servers_list/ns2/named.conf.j2 b/bin/tests/system/xfer_servers_list/ns2/named.conf.j2 index 618958e6be7..9be27c0c7d8 100644 --- a/bin/tests/system/xfer_servers_list/ns2/named.conf.j2 +++ b/bin/tests/system/xfer_servers_list/ns2/named.conf.j2 @@ -1,7 +1,8 @@ options { + port @PORT@; query-source address 10.53.0.2; notify-source 10.53.0.2; - listen-on port @PORT@ { 10.53.0.2; }; + listen-on { 10.53.0.2; }; transfer-source 10.53.0.2; pid-file "named.pid"; recursion no; diff --git a/bin/tests/system/xfer_servers_list/ns3/named.conf.j2 b/bin/tests/system/xfer_servers_list/ns3/named.conf.j2 index 96094ee1265..4e5b928c130 100644 --- a/bin/tests/system/xfer_servers_list/ns3/named.conf.j2 +++ b/bin/tests/system/xfer_servers_list/ns3/named.conf.j2 @@ -1,7 +1,8 @@ options { + port @PORT@; query-source address 10.53.0.3; notify-source 10.53.0.3; - listen-on port @PORT@ { 10.53.0.3; }; + listen-on { 10.53.0.3; }; transfer-source 10.53.0.3; pid-file "named.pid"; recursion no; diff --git a/bin/tests/system/xfer_servers_list/ns4/named.conf.j2 b/bin/tests/system/xfer_servers_list/ns4/named.conf.j2 index f7b750328c7..6d7d29057b7 100644 --- a/bin/tests/system/xfer_servers_list/ns4/named.conf.j2 +++ b/bin/tests/system/xfer_servers_list/ns4/named.conf.j2 @@ -1,7 +1,8 @@ options { + port @PORT@; query-source address 10.53.0.4; notify-source 10.53.0.4; - listen-on port @PORT@ { 10.53.0.4; }; + listen-on { 10.53.0.4; }; transfer-source 10.53.0.4; pid-file "named.pid"; recursion no;