From cace00e01ba90ee49d214b17bc8dcdf5cdb505f7 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 12 Nov 2024 09:40:52 +0100 Subject: [PATCH] Start using a named primary for a test --- pdns/recursordist/Makefile.am | 2 +- pdns/recursordist/rec-system-resolve.hh | 2 +- pdns/recursordist/settings/docs-new-preamble-in.rst | 3 +++ pdns/recursordist/settings/rust/src/bridge.rs | 4 ++++ regression-tests.recursor-dnssec/test_FWCatz.py | 6 +++--- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index 6607b95cb8..a1ddf3960e 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -552,10 +552,10 @@ rec_control_SOURCES = \ rec_channel.cc rec_channel.hh \ rec_control.cc \ settings/cxxsupport.cc \ - threadname.cc threadname.hh \ sillyrecords.cc \ sortlist.cc sortlist.hh \ svc-records.cc svc-records.hh \ + threadname.cc threadname.hh \ unix_utility.cc nodist_rec_control_SOURCES = \ diff --git a/pdns/recursordist/rec-system-resolve.hh b/pdns/recursordist/rec-system-resolve.hh index 3491598b71..d03f98f538 100644 --- a/pdns/recursordist/rec-system-resolve.hh +++ b/pdns/recursordist/rec-system-resolve.hh @@ -147,5 +147,5 @@ private: static bool s_selfResolveCheck; }; - ComboAddress fromNameOrIP(const string& str, uint16_t defPort, Logr::log_t log); +ComboAddress fromNameOrIP(const string& str, uint16_t defPort, Logr::log_t log); } diff --git a/pdns/recursordist/settings/docs-new-preamble-in.rst b/pdns/recursordist/settings/docs-new-preamble-in.rst index 75c0dc0fcd..2587face2c 100644 --- a/pdns/recursordist/settings/docs-new-preamble-in.rst +++ b/pdns/recursordist/settings/docs-new-preamble-in.rst @@ -383,6 +383,8 @@ As of version 5.1.0, an RPZ entry is defined as seedFile: string If ``addresses`` is empty, the ``name`` field specifies the path name of the RPZ, otherwise the ``name`` field defines the name of the RPZ. +Starting with version 5.2.0, names instead of IP addresess can be used for ``addresses`` if +:ref:`setting-yaml-recursor.system_resolver_ttl` is set. An example of an ``rpzs`` entry, which is a sequence of `RPZ`_: @@ -497,6 +499,7 @@ As of version 5.2.0, a forwarding catalog zone entry is defined as: recurse: bool, default false notify: bool, default false +Names instead of IP addresess can be used for ``addresses`` if :ref:`setting-yaml-recursor.system_resolver_ttl` is set. An example of a :ref:`setting-yaml-recursor.forwarding_catalog_zones` entry, which is a sequence of `ForwardingCatalogZone`_: .. code-block:: yaml diff --git a/pdns/recursordist/settings/rust/src/bridge.rs b/pdns/recursordist/settings/rust/src/bridge.rs index 05872b9bea..8a2f761574 100644 --- a/pdns/recursordist/settings/rust/src/bridge.rs +++ b/pdns/recursordist/settings/rust/src/bridge.rs @@ -665,6 +665,10 @@ impl ForwardingCatalogZone { if !self.xfr.addresses.is_empty() { validate_address_family(&(field.to_owned() + ".xfr.addresses"), &(field.to_owned() + ".xfr.localAddress"), &self.xfr.addresses, &self.xfr.localAddress)?; } + else { + let msg = format!("{}.xfr.addresses: at least one address required", field); + return Err(ValidationError { msg }); + } Ok(()) } diff --git a/regression-tests.recursor-dnssec/test_FWCatz.py b/regression-tests.recursor-dnssec/test_FWCatz.py index 739f917b30..f995d8f4a9 100644 --- a/regression-tests.recursor-dnssec/test_FWCatz.py +++ b/regression-tests.recursor-dnssec/test_FWCatz.py @@ -256,16 +256,16 @@ packetcache: incoming: allow_notify_from: [127.0.0.0/8] recursor: + system_resolver_ttl: 30 forwarding_catalog_zones: - zone: forward.catz xfr: # The first server is a bogus one, to test that we correctly fail over to the second one - addresses: [127.0.0.1:9999, 127.0.0.1:%d] + addresses: [127.0.0.1:9999, localhost:%d] refresh: 1 notify_allowed: true groups: - - name: '' - forwarders: [1.2.3.4] + - forwarders: [1.2.3.4] # Default - name: 'GROUP' forwarders: [4.5.6.7] notify_allowed: true -- 2.47.2