From ca84283333d22c64abfbcb87872dd5e6d9172c5a Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 18 Sep 2007 00:22:31 +0000 Subject: [PATCH] 2244. [func] Allow the check of nameserver names against the SOA MNAME field to be disabled by specifying 'notify-to-soa yes;'. [RT #17073] --- CHANGES | 4 +++ bin/named/config.c | 3 +- bin/named/named.conf.docbook | 5 ++- bin/named/zoneconf.c | 8 ++++- doc/arm/Bv9ARM-book.xml | 33 +++++++++++++++++- lib/dns/include/dns/zone.h | 3 +- lib/dns/zone.c | 8 +++-- lib/isccfg/namedconf.c | 65 ++++++++++++++++++------------------ 8 files changed, 89 insertions(+), 40 deletions(-) diff --git a/CHANGES b/CHANGES index d73e86d889..cb245b1ed8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2244. [func] Allow the check of nameserver names against the + SOA MNAME field to be disabled by specifying + 'notify-to-soa yes;'. [RT #17073] + 2243. [func] Configuration files without a newline at the end now parse without error. [RT #17120] diff --git a/bin/named/config.c b/bin/named/config.c index 23d97e6554..aaac8e5bc0 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.80 2007/09/13 04:45:18 each Exp $ */ +/* $Id: config.c,v 1.81 2007/09/18 00:22:30 marka Exp $ */ /*! \file */ @@ -152,6 +152,7 @@ options {\n\ notify yes;\n\ # also-notify \n\ notify-delay 5;\n\ + notify-to-soa no;\n\ dialup no;\n\ # forward \n\ # forwarders \n\ diff --git a/bin/named/named.conf.docbook b/bin/named/named.conf.docbook index 33cd16236b..0981fcbaf6 100644 --- a/bin/named/named.conf.docbook +++ b/bin/named/named.conf.docbook @@ -17,7 +17,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + Aug 13, 2004 @@ -295,6 +295,7 @@ options { notify-source ( ipv4_address | * ) port ( integer | * ) ; notify-source-v6 ( ipv6_address | * ) port ( integer | * ) ; notify-delay seconds; + notify-to-soa boolean; also-notify port integer { ( ipv4_address | ipv6_address ) port integer ; ... }; allow-notify { address_match_element; ... }; @@ -451,6 +452,7 @@ view string optional_class notify-source ( ipv4_address | * ) port ( integer | * ) ; notify-source-v6 ( ipv6_address | * ) port ( integer | * ) ; notify-delay seconds; + notify-to-soa boolean; also-notify port integer { ( ipv4_address | ipv6_address ) port integer ; ... }; allow-notify { address_match_element; ... }; @@ -540,6 +542,7 @@ zone string optional_class notify-source ( ipv4_address | * ) port ( integer | * ) ; notify-source-v6 ( ipv6_address | * ) port ( integer | * ) ; notify-delay seconds; + notify-to-soa boolean; also-notify port integer { ( ipv4_address | ipv6_address ) port integer ; ... }; allow-notify { address_match_element; ... }; diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index bdc535ae86..4f53a8f149 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.138 2007/09/12 01:09:07 each Exp $ */ +/* $Id: zoneconf.c,v 1.139 2007/09/18 00:22:30 marka Exp $ */ /*% */ @@ -544,6 +544,12 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, RETERR(dns_zone_setnotifysrc6(zone, cfg_obj_assockaddr(obj))); ns_add_reserved_dispatch(ns_g_server, cfg_obj_assockaddr(obj)); + obj = NULL; + result = ns_config_get(maps, "notify-to-soa", &obj); + INSIST(result == ISC_R_SUCCESS); + dns_zone_setoption(zone, DNS_ZONEOPT_NOTIFYTOSOA, + cfg_obj_asboolean(obj)); + dns_zone_setisself(zone, ns_client_isself, NULL); RETERR(configure_zone_acl(zconfig, vconfig, config, diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index ff7b096c68..cc7a797f20 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -18,7 +18,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + BIND 9 Administrator Reference Manual @@ -4515,6 +4515,7 @@ category notify { null; }; notify-delay seconds ; notify-source (ip4_addr | *) port ip_port ; notify-source-v6 (ip6_addr | *) port ip_port ; + notify-to-soa yes_or_no ; also-notify { ip_addr port ip_port ; ip_addr port ip_port ; ... }; max-ixfr-log-size number; max-journal-size size_spec; @@ -5299,6 +5300,22 @@ options { + + notify-to-soa + + + If yes do not check the nameservers + in the NS RRset against the SOA MNAME. Normally a NOTIFY + message is not sent to the SOA MNAME (SOA ORIGIN) as it is + supposed to contain the name of the ultimate master. + Sometimes, however, a slave is listed as the SOA MNAME in + hidden master configurations and in that case you would + want the ultimate master to still send NOTIFY messages to + all the nameservers listed in the NS RRset. + + + + recursion @@ -8265,6 +8282,7 @@ view "external" { max-transfer-time-out number ; notify yes_or_no | explicit | master-only ; notify-delay seconds ; + notify-to-soa yes_or_no; pubkey number number number string ; notify-source (ip4_addr | *) port ip_port ; notify-source-v6 (ip6_addr | *) port ip_port ; @@ -8306,6 +8324,8 @@ zone zone_name class max-transfer-time-in number ; max-transfer-time-out number ; notify yes_or_no | explicit | master-only ; + notify-delay seconds ; + notify-to-soa yes_or_no; pubkey number number number string ; transfer-source (ip4_addr | *) port ip_port ; transfer-source-v6 (ip6_addr | *) port ip_port ; @@ -8967,6 +8987,17 @@ zone zone_name class + + notify-to-soa + + + See the description of + notify-to-soa in + . + + + + pubkey diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 2c57a40182..041d402204 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.h,v 1.152 2007/06/18 23:47:42 tbox Exp $ */ +/* $Id: zone.h,v 1.153 2007/09/18 00:22:31 marka Exp $ */ #ifndef DNS_ZONE_H #define DNS_ZONE_H 1 @@ -68,6 +68,7 @@ typedef enum { #define DNS_ZONEOPT_IGNORESRVCNAME 0x00400000U /*%< ignore SRV CNAME check */ #define DNS_ZONEOPT_UPDATECHECKKSK 0x00800000U /*%< check dnskey KSK flag */ #define DNS_ZONEOPT_TRYTCPREFRESH 0x01000000U /*%< try tcp refresh on udp failure */ +#define DNS_ZONEOPT_NOTIFYTOSOA 0x02000000U /*%< Notify the SOA MNAME */ #ifndef NOMINUM_PUBLIC /* diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 6751b080af..209b26a823 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.468 2007/09/12 01:09:08 each Exp $ */ +/* $Id: zone.c,v 1.469 2007/09/18 00:22:31 marka Exp $ */ /*! \file */ @@ -4049,9 +4049,11 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) { RUNTIME_CHECK(result == ISC_R_SUCCESS); dns_rdata_reset(&rdata); /* - * don't notify the master server. + * Don't notify the master server unless explictly + * configured to do so. */ - if (dns_name_compare(&master, &ns.name) == 0) { + if (!DNS_ZONE_OPTION(zone, DNS_ZONEOPT_NOTIFYTOSOA) && + dns_name_compare(&master, &ns.name) == 0) { result = dns_rdataset_next(&nsrdset); continue; } diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 7ee7897551..3fc3e8c4c8 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namedconf.c,v 1.76 2007/06/18 23:47:50 tbox Exp $ */ +/* $Id: namedconf.c,v 1.77 2007/09/18 00:22:31 marka Exp $ */ /*! \file */ @@ -815,50 +815,51 @@ view_only_clauses[] = { */ static cfg_clausedef_t zone_clauses[] = { + { "allow-notify", &cfg_type_bracketed_aml, 0 }, { "allow-query", &cfg_type_bracketed_aml, 0 }, { "allow-query-on", &cfg_type_bracketed_aml, 0 }, { "allow-transfer", &cfg_type_bracketed_aml, 0 }, { "allow-update", &cfg_type_bracketed_aml, 0 }, { "allow-update-forwarding", &cfg_type_bracketed_aml, 0 }, - { "allow-notify", &cfg_type_bracketed_aml, 0 }, - { "masterfile-format", &cfg_type_masterformat, 0 }, - { "notify", &cfg_type_notifytype, 0 }, - { "notify-source", &cfg_type_sockaddr4wild, 0 }, - { "notify-source-v6", &cfg_type_sockaddr6wild, 0 }, { "also-notify", &cfg_type_portiplist, 0 }, - { "notify-delay", &cfg_type_uint32, 0 }, - { "dialup", &cfg_type_dialuptype, 0 }, - { "forward", &cfg_type_forwardtype, 0 }, - { "forwarders", &cfg_type_portiplist, 0 }, - { "maintain-ixfr-base", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, - { "max-ixfr-log-size", &cfg_type_size, CFG_CLAUSEFLAG_OBSOLETE }, - { "max-journal-size", &cfg_type_sizenodefault, 0 }, - { "max-transfer-time-in", &cfg_type_uint32, 0 }, - { "max-transfer-time-out", &cfg_type_uint32, 0 }, - { "max-transfer-idle-in", &cfg_type_uint32, 0 }, - { "max-transfer-idle-out", &cfg_type_uint32, 0 }, - { "max-retry-time", &cfg_type_uint32, 0 }, - { "min-retry-time", &cfg_type_uint32, 0 }, - { "max-refresh-time", &cfg_type_uint32, 0 }, - { "min-refresh-time", &cfg_type_uint32, 0 }, - { "multi-master", &cfg_type_boolean, 0 }, - { "sig-validity-interval", &cfg_type_uint32, 0 }, - { "transfer-source", &cfg_type_sockaddr4wild, 0 }, - { "transfer-source-v6", &cfg_type_sockaddr6wild, 0 }, { "alt-transfer-source", &cfg_type_sockaddr4wild, 0 }, { "alt-transfer-source-v6", &cfg_type_sockaddr6wild, 0 }, - { "use-alt-transfer-source", &cfg_type_boolean, 0 }, - { "zone-statistics", &cfg_type_boolean, 0 }, - { "key-directory", &cfg_type_qstring, 0 }, - { "check-wildcard", &cfg_type_boolean, 0 }, { "check-integrity", &cfg_type_boolean, 0 }, { "check-mx", &cfg_type_checkmode, 0 }, { "check-mx-cname", &cfg_type_checkmode, 0 }, - { "check-srv-cname", &cfg_type_checkmode, 0 }, { "check-sibling", &cfg_type_boolean, 0 }, - { "zero-no-soa-ttl", &cfg_type_boolean, 0 }, - { "update-check-ksk", &cfg_type_boolean, 0 }, + { "check-srv-cname", &cfg_type_checkmode, 0 }, + { "check-wildcard", &cfg_type_boolean, 0 }, + { "dialup", &cfg_type_dialuptype, 0 }, + { "forward", &cfg_type_forwardtype, 0 }, + { "forwarders", &cfg_type_portiplist, 0 }, + { "key-directory", &cfg_type_qstring, 0 }, + { "maintain-ixfr-base", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, + { "masterfile-format", &cfg_type_masterformat, 0 }, + { "max-ixfr-log-size", &cfg_type_size, CFG_CLAUSEFLAG_OBSOLETE }, + { "max-journal-size", &cfg_type_sizenodefault, 0 }, + { "max-refresh-time", &cfg_type_uint32, 0 }, + { "max-retry-time", &cfg_type_uint32, 0 }, + { "max-transfer-idle-in", &cfg_type_uint32, 0 }, + { "max-transfer-idle-out", &cfg_type_uint32, 0 }, + { "max-transfer-time-in", &cfg_type_uint32, 0 }, + { "max-transfer-time-out", &cfg_type_uint32, 0 }, + { "min-refresh-time", &cfg_type_uint32, 0 }, + { "min-retry-time", &cfg_type_uint32, 0 }, + { "multi-master", &cfg_type_boolean, 0 }, + { "notify", &cfg_type_notifytype, 0 }, + { "notify-delay", &cfg_type_uint32, 0 }, + { "notify-source", &cfg_type_sockaddr4wild, 0 }, + { "notify-source-v6", &cfg_type_sockaddr6wild, 0 }, + { "notify-to-soa", &cfg_type_boolean, 0 }, + { "sig-validity-interval", &cfg_type_uint32, 0 }, + { "transfer-source", &cfg_type_sockaddr4wild, 0 }, + { "transfer-source-v6", &cfg_type_sockaddr6wild, 0 }, { "try-tcp-refresh", &cfg_type_boolean, 0 }, + { "update-check-ksk", &cfg_type_boolean, 0 }, + { "use-alt-transfer-source", &cfg_type_boolean, 0 }, + { "zero-no-soa-ttl", &cfg_type_boolean, 0 }, + { "zone-statistics", &cfg_type_boolean, 0 }, { NULL, NULL, 0 } };