From: Nicki Křížek Date: Tue, 28 Jul 2026 18:11:50 +0000 (+0200) Subject: Use the root-hint template for indented hint configs X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb0f7a10577145c93bec95642ab31e44c859cd2a;p=thirdparty%2Fbind9.git Use the root-hint template for indented hint configs Replace the root hints boilerplate with a template in configs where the config section should be indented, i.e. in view statements. While named doesn't care about whitespace, use the ident filter to make the final rendered config more readable. Assisted-by: Claude:claude-fable-5 --- diff --git a/bin/tests/system/addzone/ns2/named2.conf.j2 b/bin/tests/system/addzone/ns2/named2.conf.j2 index c9e8359b0ee..c168712ead4 100644 --- a/bin/tests/system/addzone/ns2/named2.conf.j2 +++ b/bin/tests/system/addzone/ns2/named2.conf.j2 @@ -23,10 +23,7 @@ view internal { response-policy { zone "policy"; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "policy" { type primary; @@ -38,10 +35,7 @@ view external { match-clients { any; }; allow-new-zones yes; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; # This view is only here to test that configuration context is cleaned diff --git a/bin/tests/system/addzone/ns2/named3.conf.j2 b/bin/tests/system/addzone/ns2/named3.conf.j2 index a481476223a..1356d1dffe2 100644 --- a/bin/tests/system/addzone/ns2/named3.conf.j2 +++ b/bin/tests/system/addzone/ns2/named3.conf.j2 @@ -23,10 +23,7 @@ view internal { response-policy { zone "policy"; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "policy" { type primary; @@ -38,20 +35,14 @@ view directory { match-clients { 10.53.0.5; }; allow-new-zones yes; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; view external { match-clients { any; }; allow-new-zones yes; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; # This view is only here to test that configuration context is cleaned diff --git a/bin/tests/system/allow_query/ns2/named21.conf.j2 b/bin/tests/system/allow_query/ns2/named21.conf.j2 index e4c2eaf634b..e00ed6aa207 100644 --- a/bin/tests/system/allow_query/ns2/named21.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named21.conf.j2 @@ -8,10 +8,7 @@ options { view "internal" { - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named22.conf.j2 b/bin/tests/system/allow_query/ns2/named22.conf.j2 index 2b64844bd60..c2d99bcdc31 100644 --- a/bin/tests/system/allow_query/ns2/named22.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named22.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { any; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named23.conf.j2 b/bin/tests/system/allow_query/ns2/named23.conf.j2 index fa508308d23..2452d863acc 100644 --- a/bin/tests/system/allow_query/ns2/named23.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named23.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { none; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named24.conf.j2 b/bin/tests/system/allow_query/ns2/named24.conf.j2 index 1cfbdeb9e99..c7e418c24b2 100644 --- a/bin/tests/system/allow_query/ns2/named24.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named24.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { 10.53.0.2; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named25.conf.j2 b/bin/tests/system/allow_query/ns2/named25.conf.j2 index 37e24c72656..8d2ff47f7c7 100644 --- a/bin/tests/system/allow_query/ns2/named25.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named25.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { 10.53.0.1; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named26.conf.j2 b/bin/tests/system/allow_query/ns2/named26.conf.j2 index 4af789c6b3a..8a10c2e13ba 100644 --- a/bin/tests/system/allow_query/ns2/named26.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named26.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query {! 10.53.0.2; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named27.conf.j2 b/bin/tests/system/allow_query/ns2/named27.conf.j2 index b8e1d4e91c3..e70e013882a 100644 --- a/bin/tests/system/allow_query/ns2/named27.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named27.conf.j2 @@ -12,10 +12,7 @@ view "internal" { allow-query { accept; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named28.conf.j2 b/bin/tests/system/allow_query/ns2/named28.conf.j2 index 53665846b36..879312bd9d1 100644 --- a/bin/tests/system/allow_query/ns2/named28.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named28.conf.j2 @@ -12,10 +12,7 @@ view "internal" { allow-query { accept; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named29.conf.j2 b/bin/tests/system/allow_query/ns2/named29.conf.j2 index 6aa26b9d3a6..a12fc1eb5b9 100644 --- a/bin/tests/system/allow_query/ns2/named29.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named29.conf.j2 @@ -12,10 +12,7 @@ view "internal" { allow-query {! accept; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named30.conf.j2 b/bin/tests/system/allow_query/ns2/named30.conf.j2 index 77880a85549..b26484c2ec8 100644 --- a/bin/tests/system/allow_query/ns2/named30.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named30.conf.j2 @@ -15,10 +15,7 @@ view "internal" { allow-query { key one; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named31.conf.j2 b/bin/tests/system/allow_query/ns2/named31.conf.j2 index c26a669c62a..854bbc1eae7 100644 --- a/bin/tests/system/allow_query/ns2/named31.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named31.conf.j2 @@ -22,10 +22,7 @@ view "internal" { allow-query { key one; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named32.conf.j2 b/bin/tests/system/allow_query/ns2/named32.conf.j2 index 0bceaf54147..ff30f0023e2 100644 --- a/bin/tests/system/allow_query/ns2/named32.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named32.conf.j2 @@ -15,10 +15,7 @@ view "internal" { allow-query {! key one; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named33.conf.j2 b/bin/tests/system/allow_query/ns2/named33.conf.j2 index 1c02e6d4605..4d14e10e5f1 100644 --- a/bin/tests/system/allow_query/ns2/named33.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named33.conf.j2 @@ -11,10 +11,7 @@ view "internal" { allow-query { any; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named34.conf.j2 b/bin/tests/system/allow_query/ns2/named34.conf.j2 index d9196a03264..ec273406011 100644 --- a/bin/tests/system/allow_query/ns2/named34.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named34.conf.j2 @@ -11,10 +11,7 @@ view "internal" { allow-query { none; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named55.conf.j2 b/bin/tests/system/allow_query/ns2/named55.conf.j2 index 7d010e65177..4db3e980335 100644 --- a/bin/tests/system/allow_query/ns2/named55.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named55.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { none; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named56.conf.j2 b/bin/tests/system/allow_query/ns2/named56.conf.j2 index a3e67aea9d3..e4ef258c1c9 100644 --- a/bin/tests/system/allow_query/ns2/named56.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named56.conf.j2 @@ -10,10 +10,7 @@ view "internal" { allow-query { any; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns2/named57.conf.j2 b/bin/tests/system/allow_query/ns2/named57.conf.j2 index 9fe197cd23b..a8c2902fa53 100644 --- a/bin/tests/system/allow_query/ns2/named57.conf.j2 +++ b/bin/tests/system/allow_query/ns2/named57.conf.j2 @@ -9,10 +9,7 @@ options { view "internal" { allow-query-on { any; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "normal.example" { type primary; diff --git a/bin/tests/system/allow_query/ns3/named5.conf.j2 b/bin/tests/system/allow_query/ns3/named5.conf.j2 index ed81cf3c614..0b21fa28cd0 100644 --- a/bin/tests/system/allow_query/ns3/named5.conf.j2 +++ b/bin/tests/system/allow_query/ns3/named5.conf.j2 @@ -12,10 +12,7 @@ options { view internal { match-destinations { 10.53.0.3; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} recursion yes; allow-recursion { any; }; diff --git a/bin/tests/system/allow_query/ns3/named6.conf.j2 b/bin/tests/system/allow_query/ns3/named6.conf.j2 index 1343c4faa7a..723c58430e7 100644 --- a/bin/tests/system/allow_query/ns3/named6.conf.j2 +++ b/bin/tests/system/allow_query/ns3/named6.conf.j2 @@ -9,10 +9,7 @@ options { view internal { match-destinations { 10.53.0.3; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} recursion yes; allow-recursion{ any; }; }; diff --git a/bin/tests/system/allow_query/ns3/named7.conf.j2 b/bin/tests/system/allow_query/ns3/named7.conf.j2 index d50070019db..dd5846cdfd0 100644 --- a/bin/tests/system/allow_query/ns3/named7.conf.j2 +++ b/bin/tests/system/allow_query/ns3/named7.conf.j2 @@ -9,10 +9,7 @@ options { view internal { match-destinations { 10.53.0.3; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} recursion yes; allow-query{ any; }; }; diff --git a/bin/tests/system/allow_query/ns3/named8.conf.j2 b/bin/tests/system/allow_query/ns3/named8.conf.j2 index cea81a39058..9f1ddbb6ed5 100644 --- a/bin/tests/system/allow_query/ns3/named8.conf.j2 +++ b/bin/tests/system/allow_query/ns3/named8.conf.j2 @@ -11,10 +11,7 @@ options { {% include "_common/controls.conf.j2" %} view internal { - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} recursion yes; allow-query-cache { 10.53.0.3; 10.53.0.4; }; diff --git a/bin/tests/system/dnssec/ns4/named.conf.j2 b/bin/tests/system/dnssec/ns4/named.conf.j2 index 511d82f84ea..77b77b8cf31 100644 --- a/bin/tests/system/dnssec/ns4/named.conf.j2 +++ b/bin/tests/system/dnssec/ns4/named.conf.j2 @@ -44,10 +44,7 @@ include "trusted.conf"; include "trusted.conf"; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone secure.example { type static-stub; @@ -65,10 +62,7 @@ include "trusted.conf"; allow-recursion { none; }; dnssec-validation no; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone secure.example { type secondary; @@ -81,8 +75,5 @@ include "trusted.conf"; }; }; {% else %} - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} {% endif %} diff --git a/bin/tests/system/dnssec/ns5/named.conf.j2 b/bin/tests/system/dnssec/ns5/named.conf.j2 index d9fb336926c..ae0c5891718 100644 --- a/bin/tests/system/dnssec/ns5/named.conf.j2 +++ b/bin/tests/system/dnssec/ns5/named.conf.j2 @@ -42,25 +42,16 @@ options { }; }; {% elif broken_key %} - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} include "broken.conf"; {% elif many_anchors %} - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} include "many-managed.conf"; include "many-trusted.conf"; {% else %} - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} include "trusted.conf"; {% endif %} diff --git a/bin/tests/system/mkeys/ns7/named.conf.j2 b/bin/tests/system/mkeys/ns7/named.conf.j2 index e2eaa065b03..c93df98a366 100644 --- a/bin/tests/system/mkeys/ns7/named.conf.j2 +++ b/bin/tests/system/mkeys/ns7/named.conf.j2 @@ -9,15 +9,9 @@ options { {% include "_common/controls.conf.j2" %} view view1 { - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; view view2 { - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; diff --git a/bin/tests/system/rndc/ns3/named.conf.j2 b/bin/tests/system/rndc/ns3/named.conf.j2 index ee725b83a6a..1c08e5859d4 100644 --- a/bin/tests/system/rndc/ns3/named.conf.j2 +++ b/bin/tests/system/rndc/ns3/named.conf.j2 @@ -15,10 +15,7 @@ view all { recursion no; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} }; view none { diff --git a/bin/tests/system/views/ns2/named2.conf.j2 b/bin/tests/system/views/ns2/named2.conf.j2 index 4b7ca6f8436..db9b2a783f5 100644 --- a/bin/tests/system/views/ns2/named2.conf.j2 +++ b/bin/tests/system/views/ns2/named2.conf.j2 @@ -20,10 +20,7 @@ view "internal" { match-clients { 10.53.0.2; 10.53.0.3; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "example" { type primary; @@ -54,10 +51,7 @@ view "internal" { view "external" { match-clients { any; }; - zone "." { - type hint; - file "../../_common/root.hint"; - }; + {% include_indented "_common/root.hint.conf" %} zone "example" { type primary;