diff --git a/CHANGES b/CHANGES index 707b22d188..2dd61440d7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +4873. [doc] Grammars for named.conf included in the ARM are now + automatically generated by the configuration parser + itself. As a side effect of the work needed to + separate zone type grammars from each other, this + also makes checking of zone statements in + named-checkconf more correct and consistent. + [RT #36957] + 4872. [bug] Don't permit loading meta RR types such as TKEY from master files. [RT #47009] diff --git a/bin/named/named.conf.5 b/bin/named/named.conf.5 index b91a77a493..3e9c63bd4d 100644 --- a/bin/named/named.conf.5 +++ b/bin/named/named.conf.5 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2004-2017 Internet Systems Consortium, Inc. ("ISC") +.\" Copyright (C) 2004-2018 Internet Systems Consortium, Inc. ("ISC") .\" .\" This Source Code Form is subject to the terms of the Mozilla Public .\" License, v. 2.0. If a copy of the MPL was not distributed with this @@ -10,12 +10,12 @@ .\" Title: named.conf .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 2017-04-25 +.\" Date: 2018-01-08 .\" Manual: BIND9 .\" Source: ISC .\" Language: English .\" -.TH "NAMED\&.CONF" "5" "2017\-04\-25" "ISC" "BIND9" +.TH "NAMED\&.CONF" "5" "2018\-01\-08" "ISC" "BIND9" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -181,10 +181,6 @@ masters \fIstring\fR [ port \fIinteger\fR ] [ dscp .\} .nf options { - acache\-cleaning\-interval \fIinteger\fR; - acache\-enable \fIboolean\fR; - additional\-from\-auth \fIboolean\fR; - additional\-from\-cache \fIboolean\fR; allow\-new\-zones \fIboolean\fR; allow\-notify { \fIaddress_match_element\fR; \&.\&.\&. }; allow\-query { \fIaddress_match_element\fR; \&.\&.\&. }; @@ -221,8 +217,9 @@ options { check\-integrity \fIboolean\fR; check\-mx ( fail | warn | ignore ); check\-mx\-cname ( fail | warn | ignore ); - check\-names ( master | slave | response - ) ( fail | warn | ignore ); + check\-names ( primary | master | + secondary | slave | response ) ( + fail | warn | ignore ); check\-sibling \fIboolean\fR; check\-spf ( warn | ignore ); check\-srv\-cname ( fail | warn | ignore ); @@ -254,6 +251,8 @@ options { }; dns64\-contact \fIstring\fR; dns64\-server \fIstring\fR; + dnsrps\-enable \fIboolean\fR; + dnsrps\-options { \fIunspecified\-text\fR }; dnssec\-accept\-expired \fIboolean\fR; dnssec\-dnskey\-kskonly \fIboolean\fR; dnssec\-enable \fIboolean\fR; @@ -302,12 +301,14 @@ options { fstrm\-set\-output\-queue\-size \fIinteger\fR; fstrm\-set\-reopen\-interval \fIinteger\fR; geoip\-directory ( \fIquoted_string\fR | none ); - geoip\-use\-ecs ( \fIquoted_string\fR | none ); + geoip\-use\-ecs \fIboolean\fR; + glue\-cache \fIboolean\fR; heartbeat\-interval \fIinteger\fR; hostname ( \fIquoted_string\fR | none ); inline\-signing \fIboolean\fR; interface\-interval \fIinteger\fR; - ixfr\-from\-differences ( master | slave | \fIboolean\fR ); + ixfr\-from\-differences ( primary | master | secondary | slave | + \fIboolean\fR ); keep\-response\-order { \fIaddress_match_element\fR; \&.\&.\&. }; key\-directory \fIquoted_string\fR; lame\-ttl \fIttlval\fR; @@ -323,11 +324,10 @@ options { masterfile\-format ( map | raw | text ); masterfile\-style ( full | relative ); match\-mapped\-addresses \fIboolean\fR; - max\-acache\-size ( unlimited | \fIsizeval\fR ); max\-cache\-size ( default | unlimited | \fIsizeval\fR | \fIpercentage\fR ); max\-cache\-ttl \fIinteger\fR; max\-clients\-per\-query \fIinteger\fR; - max\-journal\-size ( unlimited | \fIsizeval\fR ); + max\-journal\-size ( default | unlimited | \fIsizeval\fR ); max\-ncache\-ttl \fIinteger\fR; max\-records \fIinteger\fR; max\-recursion\-depth \fIinteger\fR; @@ -335,6 +335,7 @@ options { max\-refresh\-time \fIinteger\fR; max\-retry\-time \fIinteger\fR; max\-rsa\-exponent\-size \fIinteger\fR; + max\-stale\-ttl \fIttlval\fR; max\-transfer\-idle\-in \fIinteger\fR; max\-transfer\-idle\-out \fIinteger\fR; max\-transfer\-time\-in \fIinteger\fR; @@ -349,6 +350,7 @@ options { minimal\-any \fIboolean\fR; minimal\-responses ( no\-auth | no\-auth\-recursive | \fIboolean\fR ); multi\-master \fIboolean\fR; + new\-zones\-directory \fIquoted_string\fR; no\-case\-compress { \fIaddress_match_element\fR; \&.\&.\&. }; nocookie\-udp\-size \fIinteger\fR; notify ( explicit | master\-only | \fIboolean\fR ); @@ -359,7 +361,6 @@ options { notify\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; notify\-to\-soa \fIboolean\fR; - nsec3\-test\-zone \fIboolean\fR; // test only nta\-lifetime \fIttlval\fR; nta\-recheck \fIttlval\fR; nxdomain\-redirect \fIstring\fR; @@ -375,7 +376,7 @@ options { \fIinteger\fR | * ) ] ) | ( [ [ address ] ( \fIipv6_address\fR | * ) ] port ( \fIinteger\fR | * ) ) ) [ dscp \fIinteger\fR ]; querylog \fIboolean\fR; - random\-device \fIquoted_string\fR; + random\-device ( \fIquoted_string\fR | none ); rate\-limit { all\-per\-second \fIinteger\fR; errors\-per\-second \fIinteger\fR; @@ -401,17 +402,23 @@ options { request\-nsid \fIboolean\fR; require\-server\-cookie \fIboolean\fR; reserved\-sockets \fIinteger\fR; + resolver\-nonbackoff\-tries \fIinteger\fR; resolver\-query\-timeout \fIinteger\fR; + resolver\-retry\-interval \fIinteger\fR; response\-padding { \fIaddress_match_element\fR; \&.\&.\&. } block\-size \fIinteger\fR; response\-policy { zone \fIquoted_string\fR [ log \fIboolean\fR ] [ max\-policy\-ttl \fIinteger\fR ] [ min\-update\-interval \fIinteger\fR ] [ policy ( cname | disabled | drop | given | no\-op | nodata | nxdomain | passthru | tcp\-only \fIquoted_string\fR ) ] [ - recursive\-only \fIboolean\fR ]; \&.\&.\&. } [ break\-dnssec \fIboolean\fR ] [ + recursive\-only \fIboolean\fR ] [ nsip\-enable \fIboolean\fR ] [ + nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [ break\-dnssec \fIboolean\fR ] [ max\-policy\-ttl \fIinteger\fR ] [ min\-update\-interval \fIinteger\fR ] [ min\-ns\-dots \fIinteger\fR ] [ nsip\-wait\-recurse \fIboolean\fR ] [ - qname\-wait\-recurse \fIboolean\fR ] [ recursive\-only \fIboolean\fR ]; + qname\-wait\-recurse \fIboolean\fR ] [ recursive\-only \fIboolean\fR ] [ + nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [ + dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR + } ]; root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ]; rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name \fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. }; @@ -430,6 +437,8 @@ options { sig\-validity\-interval \fIinteger\fR [ \fIinteger\fR ]; sortlist { \fIaddress_match_element\fR; \&.\&.\&. }; stacksize ( default | unlimited | \fIsizeval\fR ); + stale\-answer\-enable \fIboolean\fR; + stale\-answer\-ttl \fIttlval\fR; startup\-notify\-rate \fIinteger\fR; statistics\-file \fIquoted_string\fR; synth\-from\-dnssec \fIboolean\fR; @@ -545,10 +554,6 @@ trusted\-keys { \fIstring\fR \fIinteger\fR \fIinteger\fR .\} .nf view \fIstring\fR [ \fIclass\fR ] { - acache\-cleaning\-interval \fIinteger\fR; - acache\-enable \fIboolean\fR; - additional\-from\-auth \fIboolean\fR; - additional\-from\-cache \fIboolean\fR; allow\-new\-zones \fIboolean\fR; allow\-notify { \fIaddress_match_element\fR; \&.\&.\&. }; allow\-query { \fIaddress_match_element\fR; \&.\&.\&. }; @@ -580,8 +585,9 @@ view \fIstring\fR [ \fIclass\fR ] { check\-integrity \fIboolean\fR; check\-mx ( fail | warn | ignore ); check\-mx\-cname ( fail | warn | ignore ); - check\-names ( master | slave | response - ) ( fail | warn | ignore ); + check\-names ( primary | master | + secondary | slave | response ) ( + fail | warn | ignore ); check\-sibling \fIboolean\fR; check\-spf ( warn | ignore ); check\-srv\-cname ( fail | warn | ignore ); @@ -612,6 +618,8 @@ view \fIstring\fR [ \fIclass\fR ] { }; dns64\-contact \fIstring\fR; dns64\-server \fIstring\fR; + dnsrps\-enable \fIboolean\fR; + dnsrps\-options { \fIunspecified\-text\fR }; dnssec\-accept\-expired \fIboolean\fR; dnssec\-dnskey\-kskonly \fIboolean\fR; dnssec\-enable \fIboolean\fR; @@ -643,8 +651,10 @@ view \fIstring\fR [ \fIclass\fR ] { forward ( first | only ); forwarders [ port \fIinteger\fR ] [ dscp \fIinteger\fR ] { ( \fIipv4_address\fR | \fIipv6_address\fR ) [ port \fIinteger\fR ] [ dscp \fIinteger\fR ]; \&.\&.\&. }; + glue\-cache \fIboolean\fR; inline\-signing \fIboolean\fR; - ixfr\-from\-differences ( master | slave | \fIboolean\fR ); + ixfr\-from\-differences ( primary | master | secondary | slave | + \fIboolean\fR ); key \fIstring\fR { algorithm \fIstring\fR; secret \fIstring\fR; @@ -660,17 +670,17 @@ view \fIstring\fR [ \fIclass\fR ] { match\-clients { \fIaddress_match_element\fR; \&.\&.\&. }; match\-destinations { \fIaddress_match_element\fR; \&.\&.\&. }; match\-recursive\-only \fIboolean\fR; - max\-acache\-size ( unlimited | \fIsizeval\fR ); max\-cache\-size ( default | unlimited | \fIsizeval\fR | \fIpercentage\fR ); max\-cache\-ttl \fIinteger\fR; max\-clients\-per\-query \fIinteger\fR; - max\-journal\-size ( unlimited | \fIsizeval\fR ); + max\-journal\-size ( default | unlimited | \fIsizeval\fR ); max\-ncache\-ttl \fIinteger\fR; max\-records \fIinteger\fR; max\-recursion\-depth \fIinteger\fR; max\-recursion\-queries \fIinteger\fR; max\-refresh\-time \fIinteger\fR; max\-retry\-time \fIinteger\fR; + max\-stale\-ttl \fIttlval\fR; max\-transfer\-idle\-in \fIinteger\fR; max\-transfer\-idle\-out \fIinteger\fR; max\-transfer\-time\-in \fIinteger\fR; @@ -683,6 +693,7 @@ view \fIstring\fR [ \fIclass\fR ] { minimal\-any \fIboolean\fR; minimal\-responses ( no\-auth | no\-auth\-recursive | \fIboolean\fR ); multi\-master \fIboolean\fR; + new\-zones\-directory \fIquoted_string\fR; no\-case\-compress { \fIaddress_match_element\fR; \&.\&.\&. }; nocookie\-udp\-size \fIinteger\fR; notify ( explicit | master\-only | \fIboolean\fR ); @@ -692,7 +703,6 @@ view \fIstring\fR [ \fIclass\fR ] { notify\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; notify\-to\-soa \fIboolean\fR; - nsec3\-test\-zone \fIboolean\fR; // test only nta\-lifetime \fIttlval\fR; nta\-recheck \fIttlval\fR; nxdomain\-redirect \fIstring\fR; @@ -727,17 +737,23 @@ view \fIstring\fR [ \fIclass\fR ] { request\-ixfr \fIboolean\fR; request\-nsid \fIboolean\fR; require\-server\-cookie \fIboolean\fR; + resolver\-nonbackoff\-tries \fIinteger\fR; resolver\-query\-timeout \fIinteger\fR; + resolver\-retry\-interval \fIinteger\fR; response\-padding { \fIaddress_match_element\fR; \&.\&.\&. } block\-size \fIinteger\fR; response\-policy { zone \fIquoted_string\fR [ log \fIboolean\fR ] [ max\-policy\-ttl \fIinteger\fR ] [ min\-update\-interval \fIinteger\fR ] [ policy ( cname | disabled | drop | given | no\-op | nodata | nxdomain | passthru | tcp\-only \fIquoted_string\fR ) ] [ - recursive\-only \fIboolean\fR ]; \&.\&.\&. } [ break\-dnssec \fIboolean\fR ] [ + recursive\-only \fIboolean\fR ] [ nsip\-enable \fIboolean\fR ] [ + nsdname\-enable \fIboolean\fR ]; \&.\&.\&. } [ break\-dnssec \fIboolean\fR ] [ max\-policy\-ttl \fIinteger\fR ] [ min\-update\-interval \fIinteger\fR ] [ min\-ns\-dots \fIinteger\fR ] [ nsip\-wait\-recurse \fIboolean\fR ] [ - qname\-wait\-recurse \fIboolean\fR ] [ recursive\-only \fIboolean\fR ]; + qname\-wait\-recurse \fIboolean\fR ] [ recursive\-only \fIboolean\fR ] [ + nsip\-enable \fIboolean\fR ] [ nsdname\-enable \fIboolean\fR ] [ + dnsrps\-enable \fIboolean\fR ] [ dnsrps\-options { \fIunspecified\-text\fR + } ]; root\-delegation\-only [ exclude { \fIquoted_string\fR; \&.\&.\&. } ]; rrset\-order { [ class \fIstring\fR ] [ type \fIstring\fR ] [ name \fIquoted_string\fR ] \fIstring\fR \fIstring\fR; \&.\&.\&. }; @@ -783,6 +799,8 @@ view \fIstring\fR [ \fIclass\fR ] { sig\-signing\-type \fIinteger\fR; sig\-validity\-interval \fIinteger\fR [ \fIinteger\fR ]; sortlist { \fIaddress_match_element\fR; \&.\&.\&. }; + stale\-answer\-enable \fIboolean\fR; + stale\-answer\-ttl \fIttlval\fR; synth\-from\-dnssec \fIboolean\fR; transfer\-format ( many\-answers | one\-answer ); transfer\-source ( \fIipv4_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ @@ -849,7 +867,7 @@ view \fIstring\fR [ \fIclass\fR ] { | \fIipv4_address\fR [ port \fIinteger\fR ] | \fIipv6_address\fR [ port \fIinteger\fR ] ) [ key \fIstring\fR ]; \&.\&.\&. }; max\-ixfr\-log\-size ( default | unlimited | - max\-journal\-size ( unlimited | \fIsizeval\fR ); + max\-journal\-size ( default | unlimited | \fIsizeval\fR ); max\-records \fIinteger\fR; max\-refresh\-time \fIinteger\fR; max\-retry\-time \fIinteger\fR; @@ -868,7 +886,6 @@ view \fIstring\fR [ \fIclass\fR ] { notify\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; notify\-to\-soa \fIboolean\fR; - nsec3\-test\-zone \fIboolean\fR; // test only pubkey \fIinteger\fR \fIinteger\fR \fIinteger\fR @@ -887,8 +904,9 @@ view \fIstring\fR [ \fIclass\fR ] { transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; try\-tcp\-refresh \fIboolean\fR; - type ( delegation\-only | forward | hint | master | redirect - | slave | static\-stub | stub ); + type ( primary | master | secondary | slave | + delegation\-only | forward | hint | redirect | + static\-stub | stub ); update\-check\-ksk \fIboolean\fR; update\-policy ( local | { ( deny | grant ) \fIstring\fR ( 6to4\-self | external | krb5\-self | krb5\-subdomain | @@ -957,7 +975,7 @@ zone \fIstring\fR [ \fIclass\fR ] { masters [ port \fIinteger\fR ] [ dscp \fIinteger\fR ] { ( \fImasters\fR | \fIipv4_address\fR [ port \fIinteger\fR ] | \fIipv6_address\fR [ port \fIinteger\fR ] ) [ key \fIstring\fR ]; \&.\&.\&. }; - max\-journal\-size ( unlimited | \fIsizeval\fR ); + max\-journal\-size ( default | unlimited | \fIsizeval\fR ); max\-records \fIinteger\fR; max\-refresh\-time \fIinteger\fR; max\-retry\-time \fIinteger\fR; @@ -976,7 +994,6 @@ zone \fIstring\fR [ \fIclass\fR ] { notify\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; notify\-to\-soa \fIboolean\fR; - nsec3\-test\-zone \fIboolean\fR; // test only pubkey \fIinteger\fR \fIinteger\fR request\-expire \fIboolean\fR; request\-ixfr \fIboolean\fR; @@ -993,8 +1010,8 @@ zone \fIstring\fR [ \fIclass\fR ] { transfer\-source\-v6 ( \fIipv6_address\fR | * ) [ port ( \fIinteger\fR | * ) ] [ dscp \fIinteger\fR ]; try\-tcp\-refresh \fIboolean\fR; - type ( delegation\-only | forward | hint | master | redirect | slave - | static\-stub | stub ); + type ( primary | master | secondary | slave | delegation\-only | + forward | hint | redirect | static\-stub | stub ); update\-check\-ksk \fIboolean\fR; update\-policy ( local | { ( deny | grant ) \fIstring\fR ( 6to4\-self | external | krb5\-self | krb5\-subdomain | ms\-self | ms\-subdomain @@ -1024,5 +1041,5 @@ BIND 9 Administrator Reference Manual\&. \fBInternet Systems Consortium, Inc\&.\fR .SH "COPYRIGHT" .br -Copyright \(co 2004-2017 Internet Systems Consortium, Inc. ("ISC") +Copyright \(co 2004-2018 Internet Systems Consortium, Inc. ("ISC") .br diff --git a/bin/named/named.conf.docbook b/bin/named/named.conf.docbook index 9ffae9fa3d..adc1e7e9df 100644 --- a/bin/named/named.conf.docbook +++ b/bin/named/named.conf.docbook @@ -1,5 +1,5 @@ + + + + +acl string { address_match_element; ... }; + diff --git a/doc/arm/controls.grammar.xml b/doc/arm/controls.grammar.xml new file mode 100644 index 0000000000..51864c963f --- /dev/null +++ b/doc/arm/controls.grammar.xml @@ -0,0 +1,23 @@ + + + + + +controls { + inet ( ipv4_address | ipv6_address | + * ) [ port ( integer | * ) ] allow + { address_match_element; ... } [ + keys { string; ... } ] [ read-only + boolean ]; + unix quoted_string perm integer + owner integer group integer [ + keys { string; ... } ] [ read-only + boolean ]; +}; + diff --git a/doc/arm/delegation-only.zoneopt.xml b/doc/arm/delegation-only.zoneopt.xml new file mode 100644 index 0000000000..b367fb0313 --- /dev/null +++ b/doc/arm/delegation-only.zoneopt.xml @@ -0,0 +1,14 @@ + + + + +zone string [ class ] { + type delegation-only; +}; + diff --git a/doc/arm/forward.zoneopt.xml b/doc/arm/forward.zoneopt.xml new file mode 100644 index 0000000000..4d8e9c1246 --- /dev/null +++ b/doc/arm/forward.zoneopt.xml @@ -0,0 +1,17 @@ + + + + +zone string [ class ] { + type forward; + delegation-only boolean; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; +}; + diff --git a/doc/arm/hint.zoneopt.xml b/doc/arm/hint.zoneopt.xml new file mode 100644 index 0000000000..d2716aa4a0 --- /dev/null +++ b/doc/arm/hint.zoneopt.xml @@ -0,0 +1,17 @@ + + + + +zone string [ class ] { + type hint; + check-names ( fail | warn | ignore ); + delegation-only boolean; + file quoted_string; +}; + diff --git a/doc/arm/in-view.zoneopt.xml b/doc/arm/in-view.zoneopt.xml new file mode 100644 index 0000000000..729a66219c --- /dev/null +++ b/doc/arm/in-view.zoneopt.xml @@ -0,0 +1,14 @@ + + + + +zone string [ class ] { + in-view string; +}; + diff --git a/doc/arm/key.grammar.xml b/doc/arm/key.grammar.xml new file mode 100644 index 0000000000..2fceb9cd69 --- /dev/null +++ b/doc/arm/key.grammar.xml @@ -0,0 +1,16 @@ + + + + + +key string { + algorithm string; + secret string; +}; + diff --git a/doc/arm/logging.grammar.xml b/doc/arm/logging.grammar.xml new file mode 100644 index 0000000000..f9b3130125 --- /dev/null +++ b/doc/arm/logging.grammar.xml @@ -0,0 +1,27 @@ + + + + + +logging { + category string { string; ... }; + channel string { + buffered boolean; + file quoted_string [ versions ( unlimited | integer ) ] + [ size size ] [ suffix ( increment | timestamp ) ]; + null; + print-category boolean; + print-severity boolean; + print-time ( iso8601 | iso8601-utc | local | boolean ); + severity log_severity; + stderr; + syslog [ syslog_facility ]; + }; +}; + diff --git a/doc/arm/man.named.conf.html b/doc/arm/man.named.conf.html index b59af7caa1..040a195639 100644 --- a/doc/arm/man.named.conf.html +++ b/doc/arm/man.named.conf.html @@ -89,14 +89,14 @@ acl


controls {
inet ( ipv4_address | ipv6_address |
-     * ) [ port ( integer | * ) ] allow
-     { address_match_element; ... } [
-     keys { string; ... } 
] [ read-only
-     boolean 
];
+     * ) [ port ( integer | * ) ] allow
+     { address_match_element; ... } [
+     keys { string; ... } ] [ read-only
+     boolean ];
unix quoted_string perm integer
-     owner integer group integer [
-     keys { string; ... } 
] [ read-only
-     boolean 
];
+     owner integer group integer [
+     keys { string; ... } ] [ read-only
+     boolean ];
};

@@ -140,20 +140,21 @@ logging category string { string; ... };
channel string {
buffered boolean;
- file quoted_string [ versions ( unlimited | integer ) ]
-     [ size size ] [ suffix ( increment | timestamp ) ];
+ file quoted_string [ versions ( unlimited | integer ) ]
+     [ size size ] [ suffix ( increment | timestamp ) ];
null;
print-category boolean;
print-severity boolean;
print-time ( iso8601 | iso8601-utc | local | boolean );
severity log_severity;
stderr;
- syslog [ syslog_facility ];
+ syslog [ syslog_facility ];
};
};

+

MANAGED-KEYS

@@ -167,10 +168,10 @@ managed-keys

MASTERS


-masters string [ port integer ] [ dscp
-    integer 
] { ( masters | ipv4_address [
-    port integer 
] | ipv6_address [ port
-    integer 
] ) [ key string ]; ... };
+masters string [ port integer ] [ dscp
+    integer ] { ( masters | ipv4_address [
+    port integer ] | ipv6_address [ port
+    integer ] ) [ key string ]; ... };

@@ -179,10 +180,6 @@ masters


options {
- acache-cleaning-interval integer;
- acache-enable boolean;
- additional-from-auth boolean;
- additional-from-cache boolean;
allow-new-zones boolean;
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
@@ -194,13 +191,13 @@ options allow-transfer { address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
- also-notify [ port integer ] [ dscp integer ] { ( masters |
-     ipv4_address [ port integer ] | ipv6_address [ port
-     integer 
] ) [ key string ]; ... };
- alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
- alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
-     * ) 
] [ dscp integer ];
+ also-notify [ port integer ] [ dscp integer ] { ( masters |
+     ipv4_address [ port integer ] | ipv6_address [ port
+     integer ] ) [ key string ]; ... };
+ alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
+ alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
+     * ) ] [ dscp integer ];
attach-cache string;
auth-nxdomain boolean; // default changed
auto-dnssec ( allow | maintain | off );
@@ -210,17 +207,18 @@ options bindkeys-file quoted_string;
blackhole { address_match_element; ... };
cache-file quoted_string;
- catalog-zones { zone quoted_string [ default-masters [ port
-     integer 
] [ dscp integer ] { ( masters | ipv4_address [
-     port integer 
] | ipv6_address [ port integer ] ) [ key
-     string 
]; ... } 
] [ zone-directory quoted_string ] [
-     in-memory boolean 
] [ min-update-interval integer ]; ... };
+ catalog-zones { zone quoted_string [ default-masters [ port
+     integer ] [ dscp integer ] { ( masters | ipv4_address [
+     port integer ] | ipv6_address [ port integer ] ) [ key
+     string ]; ... } ] [ zone-directory quoted_string ] [
+     in-memory boolean ] [ min-update-interval integer ]; ... };
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
check-mx ( fail | warn | ignore );
check-mx-cname ( fail | warn | ignore );
- check-names ( master | slave | response
-     ) ( fail | warn | ignore );
+ check-names ( primary | master |
+     secondary | slave | response ) (
+     fail | warn | ignore );
check-sibling boolean;
check-spf ( warn | ignore );
check-srv-cname ( fail | warn | ignore );
@@ -231,10 +229,10 @@ options cookie-secret string;
coresize ( default | unlimited | sizeval );
datasize ( default | unlimited | sizeval );
- deny-answer-addresses { address_match_element; ... } [
-     except-from { quoted_string; ... } 
];
- deny-answer-aliases { quoted_string; ... } [ except-from {
-     quoted_string; ... } 
];
+ deny-answer-addresses { address_match_element; ... } [
+     except-from { quoted_string; ... } ];
+ deny-answer-aliases { quoted_string; ... } [ except-from {
+     quoted_string; ... } ];
dialup ( notify | notify-passive | passive | refresh | boolean );
directory quoted_string;
disable-algorithms string { string;
@@ -252,6 +250,8 @@ options };
dns64-contact string;
dns64-server string;
+ dnsrps-enable boolean;
+ dnsrps-options { unspecified-text };
dnssec-accept-expired boolean;
dnssec-dnskey-kskonly boolean;
dnssec-enable boolean;
@@ -263,35 +263,35 @@ options dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
-     resolver ) [ ( query | response ) ]; ... };
+     resolver ) [ ( query | response ) ]; ... };
dnstap-identity ( quoted_string | none |
    hostname );
- dnstap-output ( file | unix ) quoted_string [
-     size ( unlimited | size ) 
] [ versions (
-     unlimited | integer ) 
] [ suffix ( increment
-     | timestamp ) 
];
+ dnstap-output ( file | unix ) quoted_string [
+     size ( unlimited | size ) ] [ versions (
+     unlimited | integer ) ] [ suffix ( increment
+     | timestamp ) ];
dnstap-version ( quoted_string | none );
dscp integer;
- dual-stack-servers [ port integer ] { ( quoted_string [ port
-     integer 
] [ dscp integer ] | ipv4_address [ port
-     integer 
] [ dscp integer ] | ipv6_address [ port
-     integer 
] [ dscp integer ] ); ... };
+ dual-stack-servers [ port integer ] { ( quoted_string [ port
+     integer ] [ dscp integer ] | ipv4_address [ port
+     integer ] [ dscp integer ] | ipv6_address [ port
+     integer ] [ dscp integer ] ); ... };
dump-file quoted_string;
edns-udp-size integer;
empty-contact string;
empty-server string;
empty-zones-enable boolean;
fetch-quota-params integer fixedpoint fixedpoint fixedpoint;
- fetches-per-server integer [ ( drop | fail ) ];
- fetches-per-zone integer [ ( drop | fail ) ];
+ fetches-per-server integer [ ( drop | fail ) ];
+ fetches-per-zone integer [ ( drop | fail ) ];
files ( default | unlimited | sizeval );
filter-aaaa { address_match_element; ... };
filter-aaaa-on-v4 ( break-dnssec | boolean );
filter-aaaa-on-v6 ( break-dnssec | boolean );
flush-zones-on-shutdown boolean;
forward ( first | only );
- forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
-     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
+ forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
+     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
fstrm-set-buffer-hint integer;
fstrm-set-flush-timeout integer;
fstrm-set-input-queue-size integer;
@@ -300,20 +300,22 @@ options fstrm-set-output-queue-size integer;
fstrm-set-reopen-interval integer;
geoip-directory ( quoted_string | none );
- geoip-use-ecs ( quoted_string | none );
+ geoip-use-ecs boolean;
+ glue-cache boolean;
heartbeat-interval integer;
hostname ( quoted_string | none );
inline-signing boolean;
interface-interval integer;
- ixfr-from-differences ( master | slave | boolean );
+ ixfr-from-differences ( primary | master | secondary | slave |
+     boolean );
keep-response-order { address_match_element; ... };
key-directory quoted_string;
lame-ttl ttlval;
- listen-on [ port integer ] [ dscp
-     integer 
] {
+ listen-on [ port integer ] [ dscp
+     integer ] {
    address_match_element; ... };
- listen-on-v6 [ port integer ] [ dscp
-     integer 
] {
+ listen-on-v6 [ port integer ] [ dscp
+     integer ] {
    address_match_element; ... };
lmdb-mapsize sizeval;
lock-file ( quoted_string | none );
@@ -321,11 +323,10 @@ options masterfile-format ( map | raw | text );
masterfile-style ( full | relative );
match-mapped-addresses boolean;
- max-acache-size ( unlimited | sizeval );
max-cache-size ( default | unlimited | sizeval | percentage );
max-cache-ttl integer;
max-clients-per-query integer;
- max-journal-size ( unlimited | sizeval );
+ max-journal-size ( default | unlimited | sizeval );
max-ncache-ttl integer;
max-records integer;
max-recursion-depth integer;
@@ -333,6 +334,7 @@ options max-refresh-time integer;
max-retry-time integer;
max-rsa-exponent-size integer;
+ max-stale-ttl ttlval;
max-transfer-idle-in integer;
max-transfer-idle-out integer;
max-transfer-time-in integer;
@@ -347,33 +349,33 @@ options minimal-any boolean;
minimal-responses ( no-auth | no-auth-recursive | boolean );
multi-master boolean;
+ new-zones-directory quoted_string;
no-case-compress { address_match_element; ... };
nocookie-udp-size integer;
notify ( explicit | master-only | boolean );
notify-delay integer;
notify-rate integer;
- notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
-     [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
+     [ dscp integer ];
notify-to-soa boolean;
- nsec3-test-zone boolean; // test only
nta-lifetime ttlval;
nta-recheck ttlval;
nxdomain-redirect string;
pid-file ( quoted_string | none );
port integer;
preferred-glue string;
- prefetch integer [ integer ];
+ prefetch integer [ integer ];
provide-ixfr boolean;
- query-source ( ( [ address ] ( ipv4_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv4_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
- query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv6_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
+ query-source ( ( [ address ] ( ipv4_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv4_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
+ query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv6_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
querylog boolean;
- random-device quoted_string;
+ random-device ( quoted_string | none );
rate-limit {
all-per-second integer;
errors-per-second integer;
@@ -399,20 +401,26 @@ options request-nsid boolean;
require-server-cookie boolean;
reserved-sockets integer;
+ resolver-nonbackoff-tries integer;
resolver-query-timeout integer;
+ resolver-retry-interval integer;
response-padding { address_match_element; ... } block-size
    integer;
- response-policy { zone quoted_string [ log boolean ] [
-     max-policy-ttl integer 
] [ min-update-interval integer ] [
+ response-policy { zone quoted_string [ log boolean ] [
+     max-policy-ttl integer ] [ min-update-interval integer ] [
    policy ( cname | disabled | drop | given | no-op | nodata |
-     nxdomain | passthru | tcp-only quoted_string ) 
] [
-     recursive-only boolean 
]; ... } [ break-dnssec boolean ] [
-     max-policy-ttl integer 
] [ min-update-interval integer ] [
-     min-ns-dots integer 
] [ nsip-wait-recurse boolean ] [
-     qname-wait-recurse boolean 
] [ recursive-only boolean ];
- root-delegation-only [ exclude { quoted_string; ... } ];
- rrset-order { [ class string ] [ type string ] [ name
-     quoted_string 
string string; ... };
+     nxdomain | passthru | tcp-only quoted_string ) ] [
+     recursive-only boolean ] [ nsip-enable boolean ] [
+     nsdname-enable boolean ]; ... } [ break-dnssec boolean ] [
+     max-policy-ttl integer ] [ min-update-interval integer ] [
+     min-ns-dots integer ] [ nsip-wait-recurse boolean ] [
+     qname-wait-recurse boolean ] [ recursive-only boolean ] [
+     nsip-enable boolean ] [ nsdname-enable boolean ] [
+     dnsrps-enable boolean ] [ dnsrps-options { unspecified-text
+     } ];
+ root-delegation-only [ exclude { quoted_string; ... } ];
+ rrset-order { [ class string ] [ type string ] [ name
+     quoted_string ] string string; ... };
secroots-file quoted_string;
send-cookie boolean;
serial-query-rate integer;
@@ -425,9 +433,11 @@ options sig-signing-nodes integer;
sig-signing-signatures integer;
sig-signing-type integer;
- sig-validity-interval integer [ integer ];
+ sig-validity-interval integer [ integer ];
sortlist { address_match_element; ... };
stacksize ( default | unlimited | sizeval );
+ stale-answer-enable boolean;
+ stale-answer-ttl ttlval;
startup-notify-rate integer;
statistics-file quoted_string;
synth-from-dnssec boolean;
@@ -443,10 +453,10 @@ options tkey-gssapi-keytab quoted_string;
transfer-format ( many-answers | one-answer );
transfer-message-size integer;
- transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
transfers-in integer;
transfers-out integer;
transfers-per-ns integer;
@@ -476,18 +486,18 @@ server edns-version integer;
keys server_key;
max-udp-size integer;
- notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
-     [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
+     [ dscp integer ];
padding integer;
provide-ixfr boolean;
- query-source ( ( [ address ] ( ipv4_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv4_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
- query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv6_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
+ query-source ( ( [ address ] ( ipv4_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv4_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
+ query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv6_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
request-expire boolean;
request-ixfr boolean;
request-nsid boolean;
@@ -495,10 +505,10 @@ server tcp-keepalive boolean;
tcp-only boolean;
transfer-format ( many-answers | one-answer );
- transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
transfers integer;
};

@@ -510,9 +520,9 @@ server


statistics-channels {
inet ( ipv4_address | ipv6_address |
-     * ) [ port ( integer | * ) ] [
+     * ) [ port ( integer | * ) ] [
    allow { address_match_element; ...
-     } 
];
+     } ];
};

@@ -530,11 +540,7 @@ trusted-keys

VIEW


-view string [ class ] {
- acache-cleaning-interval integer;
- acache-enable boolean;
- additional-from-auth boolean;
- additional-from-cache boolean;
+view string [ class ] {
allow-new-zones boolean;
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
@@ -546,38 +552,39 @@ view allow-transfer { address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
- also-notify [ port integer ] [ dscp integer ] { ( masters |
-     ipv4_address [ port integer ] | ipv6_address [ port
-     integer 
] ) [ key string ]; ... };
- alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
- alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
-     * ) 
] [ dscp integer ];
+ also-notify [ port integer ] [ dscp integer ] { ( masters |
+     ipv4_address [ port integer ] | ipv6_address [ port
+     integer ] ) [ key string ]; ... };
+ alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
+ alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
+     * ) ] [ dscp integer ];
attach-cache string;
auth-nxdomain boolean; // default changed
auto-dnssec ( allow | maintain | off );
cache-file quoted_string;
- catalog-zones { zone quoted_string [ default-masters [ port
-     integer 
] [ dscp integer ] { ( masters | ipv4_address [
-     port integer 
] | ipv6_address [ port integer ] ) [ key
-     string 
]; ... } 
] [ zone-directory quoted_string ] [
-     in-memory boolean 
] [ min-update-interval integer ]; ... };
+ catalog-zones { zone quoted_string [ default-masters [ port
+     integer ] [ dscp integer ] { ( masters | ipv4_address [
+     port integer ] | ipv6_address [ port integer ] ) [ key
+     string ]; ... } ] [ zone-directory quoted_string ] [
+     in-memory boolean ] [ min-update-interval integer ]; ... };
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
check-mx ( fail | warn | ignore );
check-mx-cname ( fail | warn | ignore );
- check-names ( master | slave | response
-     ) ( fail | warn | ignore );
+ check-names ( primary | master |
+     secondary | slave | response ) (
+     fail | warn | ignore );
check-sibling boolean;
check-spf ( warn | ignore );
check-srv-cname ( fail | warn | ignore );
check-wildcard boolean;
cleaning-interval integer;
clients-per-query integer;
- deny-answer-addresses { address_match_element; ... } [
-     except-from { quoted_string; ... } 
];
- deny-answer-aliases { quoted_string; ... } [ except-from {
-     quoted_string; ... } 
];
+ deny-answer-addresses { address_match_element; ... } [
+     except-from { quoted_string; ... } ];
+ deny-answer-aliases { quoted_string; ... } [ except-from {
+     quoted_string; ... } ];
dialup ( notify | notify-passive | passive | refresh | boolean );
disable-algorithms string { string;
    ... };
@@ -598,6 +605,8 @@ view };
dns64-contact string;
dns64-server string;
+ dnsrps-enable boolean;
+ dnsrps-options { unspecified-text };
dnssec-accept-expired boolean;
dnssec-dnskey-kskonly boolean;
dnssec-enable boolean;
@@ -609,11 +618,11 @@ view dnssec-update-mode ( maintain | no-resign );
dnssec-validation ( yes | no | auto );
dnstap { ( all | auth | client | forwarder |
-     resolver ) [ ( query | response ) ]; ... };
- dual-stack-servers [ port integer ] { ( quoted_string [ port
-     integer 
] [ dscp integer ] | ipv4_address [ port
-     integer 
] [ dscp integer ] | ipv6_address [ port
-     integer 
] [ dscp integer ] ); ... };
+     resolver ) [ ( query | response ) ]; ... };
+ dual-stack-servers [ port integer ] { ( quoted_string [ port
+     integer ] [ dscp integer ] | ipv4_address [ port
+     integer ] [ dscp integer ] | ipv6_address [ port
+     integer ] [ dscp integer ] ); ... };
dyndb string quoted_string {
    unspecified-text };
edns-udp-size integer;
@@ -621,16 +630,18 @@ view empty-server string;
empty-zones-enable boolean;
fetch-quota-params integer fixedpoint fixedpoint fixedpoint;
- fetches-per-server integer [ ( drop | fail ) ];
- fetches-per-zone integer [ ( drop | fail ) ];
+ fetches-per-server integer [ ( drop | fail ) ];
+ fetches-per-zone integer [ ( drop | fail ) ];
filter-aaaa { address_match_element; ... };
filter-aaaa-on-v4 ( break-dnssec | boolean );
filter-aaaa-on-v6 ( break-dnssec | boolean );
forward ( first | only );
- forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
-     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
+ forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
+     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
+ glue-cache boolean;
inline-signing boolean;
- ixfr-from-differences ( master | slave | boolean );
+ ixfr-from-differences ( primary | master | secondary | slave |
+     boolean );
key string {
algorithm string;
secret string;
@@ -646,17 +657,17 @@ view match-clients { address_match_element; ... };
match-destinations { address_match_element; ... };
match-recursive-only boolean;
- max-acache-size ( unlimited | sizeval );
max-cache-size ( default | unlimited | sizeval | percentage );
max-cache-ttl integer;
max-clients-per-query integer;
- max-journal-size ( unlimited | sizeval );
+ max-journal-size ( default | unlimited | sizeval );
max-ncache-ttl integer;
max-records integer;
max-recursion-depth integer;
max-recursion-queries integer;
max-refresh-time integer;
max-retry-time integer;
+ max-stale-ttl ttlval;
max-transfer-idle-in integer;
max-transfer-idle-out integer;
max-transfer-time-in integer;
@@ -669,28 +680,28 @@ view minimal-any boolean;
minimal-responses ( no-auth | no-auth-recursive | boolean );
multi-master boolean;
+ new-zones-directory quoted_string;
no-case-compress { address_match_element; ... };
nocookie-udp-size integer;
notify ( explicit | master-only | boolean );
notify-delay integer;
- notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
-     [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
+     [ dscp integer ];
notify-to-soa boolean;
- nsec3-test-zone boolean; // test only
nta-lifetime ttlval;
nta-recheck ttlval;
nxdomain-redirect string;
preferred-glue string;
- prefetch integer [ integer ];
+ prefetch integer [ integer ];
provide-ixfr boolean;
- query-source ( ( [ address ] ( ipv4_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv4_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
- query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
-     integer | * ) 
] ) | ( [ [ address ] ( ipv6_address | * ) ]
-     port ( integer | * ) ) ) [ dscp integer ];
+ query-source ( ( [ address ] ( ipv4_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv4_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
+ query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port (
+     integer | * ) ] ) | ( [ [ address ] ( ipv6_address | * ) ]
+     port ( integer | * ) ) ) [ dscp integer ];
rate-limit {
all-per-second integer;
errors-per-second integer;
@@ -713,20 +724,26 @@ view request-ixfr boolean;
request-nsid boolean;
require-server-cookie boolean;
+ resolver-nonbackoff-tries integer;
resolver-query-timeout integer;
+ resolver-retry-interval integer;
response-padding { address_match_element; ... } block-size
    integer;
- response-policy { zone quoted_string [ log boolean ] [
-     max-policy-ttl integer 
] [ min-update-interval integer ] [
+ response-policy { zone quoted_string [ log boolean ] [
+     max-policy-ttl integer ] [ min-update-interval integer ] [
    policy ( cname | disabled | drop | given | no-op | nodata |
-     nxdomain | passthru | tcp-only quoted_string ) 
] [
-     recursive-only boolean 
]; ... } [ break-dnssec boolean ] [
-     max-policy-ttl integer 
] [ min-update-interval integer ] [
-     min-ns-dots integer 
] [ nsip-wait-recurse boolean ] [
-     qname-wait-recurse boolean 
] [ recursive-only boolean ];
- root-delegation-only [ exclude { quoted_string; ... } ];
- rrset-order { [ class string ] [ type string ] [ name
-     quoted_string 
string string; ... };
+     nxdomain | passthru | tcp-only quoted_string ) ] [
+     recursive-only boolean ] [ nsip-enable boolean ] [
+     nsdname-enable boolean ]; ... } [ break-dnssec boolean ] [
+     max-policy-ttl integer ] [ min-update-interval integer ] [
+     min-ns-dots integer ] [ nsip-wait-recurse boolean ] [
+     qname-wait-recurse boolean ] [ recursive-only boolean ] [
+     nsip-enable boolean ] [ nsdname-enable boolean ] [
+     dnsrps-enable boolean ] [ dnsrps-options { unspecified-text
+     } ];
+ root-delegation-only [ exclude { quoted_string; ... } ];
+ rrset-order { [ class string ] [ type string ] [ name
+     quoted_string ] string string; ... };
send-cookie boolean;
serial-update-method ( date | increment | unixtime );
server netprefix {
@@ -736,20 +753,20 @@ view edns-version integer;
keys server_key;
max-udp-size integer;
- notify-source ( ipv4_address | * ) [ port ( integer | *
-     ) 
] [ dscp integer ];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer
-     | * ) 
] [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | *
+     ) ] [ dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer
+     | * ) ] [ dscp integer ];
padding integer;
provide-ixfr boolean;
- query-source ( ( [ address ] ( ipv4_address | * ) [ port
-     ( integer | * ) 
] ) | ( [ [ address ] (
-     ipv4_address | * ) 
] port ( integer | * ) ) ) [
-     dscp integer 
];
- query-source-v6 ( ( [ address ] ( ipv6_address | * ) [
-     port ( integer | * ) 
] ) | ( [ [ address ] (
-     ipv6_address | * ) 
] port ( integer | * ) ) ) [
-     dscp integer 
];
+ query-source ( ( [ address ] ( ipv4_address | * ) [ port
+     ( integer | * ) ] ) | ( [ [ address ] (
+     ipv4_address | * ) ] port ( integer | * ) ) ) [
+     dscp integer ];
+ query-source-v6 ( ( [ address ] ( ipv6_address | * ) [
+     port ( integer | * ) ] ) | ( [ [ address ] (
+     ipv6_address | * ) ] port ( integer | * ) ) ) [
+     dscp integer ];
request-expire boolean;
request-ixfr boolean;
request-nsid boolean;
@@ -757,24 +774,26 @@ view tcp-keepalive boolean;
tcp-only boolean;
transfer-format ( many-answers | one-answer );
- transfer-source ( ipv4_address | * ) [ port ( integer |
-     * ) 
] [ dscp integer ];
- transfer-source-v6 ( ipv6_address | * ) [ port (
-     integer | * ) 
] [ dscp integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer |
+     * ) ] [ dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port (
+     integer | * ) ] [ dscp integer ];
transfers integer;
};
servfail-ttl ttlval;
sig-signing-nodes integer;
sig-signing-signatures integer;
sig-signing-type integer;
- sig-validity-interval integer [ integer ];
+ sig-validity-interval integer [ integer ];
sortlist { address_match_element; ... };
+ stale-answer-enable boolean;
+ stale-answer-ttl ttlval;
synth-from-dnssec boolean;
transfer-format ( many-answers | one-answer );
- transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
trust-anchor-telemetry boolean; // experimental
trusted-keys { string integer
    integer integer quoted_string;
@@ -785,21 +804,21 @@ view v6-bias integer;
zero-no-soa-ttl boolean;
zero-no-soa-ttl-cache boolean;
- zone string [ class ] {
+ zone string [ class ] {
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
allow-query-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
- also-notify [ port integer ] [ dscp integer ] { (
-     masters | ipv4_address [ port integer ] |
-     ipv6_address [ port integer ] ) [ key string ];
+ also-notify [ port integer ] [ dscp integer ] { (
+     masters | ipv4_address [ port integer ] |
+     ipv6_address [ port integer ] ) [ key string ];
    ... };
- alt-transfer-source ( ipv4_address | * ) [ port (
-     integer | * ) 
] [ dscp integer ];
- alt-transfer-source-v6 ( ipv6_address | * ) [ port (
-     integer | * ) 
] [ dscp integer ];
+ alt-transfer-source ( ipv4_address | * ) [ port (
+     integer | * ) ] [ dscp integer ];
+ alt-transfer-source-v6 ( ipv6_address | * ) [ port (
+     integer | * ) ] [ dscp integer ];
auto-dnssec ( allow | maintain | off );
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
@@ -821,9 +840,9 @@ view dnssec-update-mode ( maintain | no-resign );
file quoted_string;
forward ( first | only );
- forwarders [ port integer ] [ dscp integer ] { (
-     ipv4_address | ipv6_address ) [ port integer ] [
-     dscp integer 
]; ... };
+ forwarders [ port integer ] [ dscp integer ] { (
+     ipv4_address | ipv6_address ) [ port integer ] [
+     dscp integer ]; ... };
in-view string;
inline-signing boolean;
ixfr-from-differences boolean;
@@ -831,11 +850,11 @@ view key-directory quoted_string;
masterfile-format ( map | raw | text );
masterfile-style ( full | relative );
- masters [ port integer ] [ dscp integer ] { ( masters
-     | ipv4_address [ port integer ] | ipv6_address [
-     port integer 
] ) [ key string ]; ... };
+ masters [ port integer ] [ dscp integer ] { ( masters
+     | ipv4_address [ port integer ] | ipv6_address [
+     port integer ] ) [ key string ]; ... };
max-ixfr-log-size ( default | unlimited |
- max-journal-size ( unlimited | sizeval );
+ max-journal-size ( default | unlimited | sizeval );
max-records integer;
max-refresh-time integer;
max-retry-time integer;
@@ -849,38 +868,38 @@ view multi-master boolean;
notify ( explicit | master-only | boolean );
notify-delay integer;
- notify-source ( ipv4_address | * ) [ port ( integer | *
-     ) 
] [ dscp integer ];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer
-     | * ) 
] [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | *
+     ) ] [ dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer
+     | * ) ] [ dscp integer ];
notify-to-soa boolean;
- nsec3-test-zone boolean; // test only
pubkey integer
    integer
    integer
request-expire boolean;
request-ixfr boolean;
serial-update-method ( date | increment | unixtime );
- server-addresses { ( ipv4_address | ipv6_address ) [
-     port integer 
]; ... };
+ server-addresses { ( ipv4_address | ipv6_address ) [
+     port integer ]; ... };
server-names { quoted_string; ... };
sig-signing-nodes integer;
sig-signing-signatures integer;
sig-signing-type integer;
- sig-validity-interval integer [ integer ];
- transfer-source ( ipv4_address | * ) [ port ( integer |
-     * ) 
] [ dscp integer ];
- transfer-source-v6 ( ipv6_address | * ) [ port (
-     integer | * ) 
] [ dscp integer ];
+ sig-validity-interval integer [ integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer |
+     * ) ] [ dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port (
+     integer | * ) ] [ dscp integer ];
try-tcp-refresh boolean;
- type ( delegation-only | forward | hint | master | redirect
-     | slave | static-stub | stub );
+ type ( primary | master | secondary | slave |
+     delegation-only | forward | hint | redirect |
+     static-stub | stub );
update-check-ksk boolean;
update-policy ( local | { ( deny | grant ) string (
    6to4-self | external | krb5-self | krb5-subdomain |
    ms-self | ms-subdomain | name | self | selfsub |
    selfwild | subdomain | tcp-self | wildcard | zonesub )
-     [ string rrtypelist; ... };
+     [ string ] rrtypelist; ... };
use-alt-transfer-source boolean;
zero-no-soa-ttl boolean;
zone-statistics ( full | terse | none | boolean );
@@ -894,20 +913,20 @@ view

ZONE


-zone string [ class ] {
+zone string [ class ] {
allow-notify { address_match_element; ... };
allow-query { address_match_element; ... };
allow-query-on { address_match_element; ... };
allow-transfer { address_match_element; ... };
allow-update { address_match_element; ... };
allow-update-forwarding { address_match_element; ... };
- also-notify [ port integer ] [ dscp integer ] { ( masters |
-     ipv4_address [ port integer ] | ipv6_address [ port
-     integer 
] ) [ key string ]; ... };
- alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
- alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
-     * ) 
] [ dscp integer ];
+ also-notify [ port integer ] [ dscp integer ] { ( masters |
+     ipv4_address [ port integer ] | ipv6_address [ port
+     integer ] ) [ key string ]; ... };
+ alt-transfer-source ( ipv4_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
+ alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer |
+     * ) ] [ dscp integer ];
auto-dnssec ( allow | maintain | off );
check-dup-records ( fail | warn | ignore );
check-integrity boolean;
@@ -928,8 +947,8 @@ zone dnssec-update-mode ( maintain | no-resign );
file quoted_string;
forward ( first | only );
- forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
-     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
+ forwarders [ port integer ] [ dscp integer ] { ( ipv4_address
+     | ipv6_address ) [ port integer ] [ dscp integer ]; ... };
in-view string;
inline-signing boolean;
ixfr-from-differences boolean;
@@ -937,10 +956,10 @@ zone key-directory quoted_string;
masterfile-format ( map | raw | text );
masterfile-style ( full | relative );
- masters [ port integer ] [ dscp integer ] { ( masters |
-     ipv4_address [ port integer ] | ipv6_address [ port
-     integer 
] ) [ key string ]; ... };
- max-journal-size ( unlimited | sizeval );
+ masters [ port integer ] [ dscp integer ] { ( masters |
+     ipv4_address [ port integer ] | ipv6_address [ port
+     integer ] ) [ key string ]; ... };
+ max-journal-size ( default | unlimited | sizeval );
max-records integer;
max-refresh-time integer;
max-retry-time integer;
@@ -954,35 +973,34 @@ zone multi-master boolean;
notify ( explicit | master-only | boolean );
notify-delay integer;
- notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
-     [ dscp integer ];
+ notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ]
+     [ dscp integer ];
notify-to-soa boolean;
- nsec3-test-zone boolean; // test only
pubkey integer integer
request-expire boolean;
request-ixfr boolean;
serial-update-method ( date | increment | unixtime );
- server-addresses { ( ipv4_address | ipv6_address ) [ port
-     integer 
]; ... };
+ server-addresses { ( ipv4_address | ipv6_address ) [ port
+     integer ]; ... };
server-names { quoted_string; ... };
sig-signing-nodes integer;
sig-signing-signatures integer;
sig-signing-type integer;
- sig-validity-interval integer [ integer ];
- transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
-     dscp integer 
];
- transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
-     
] [ dscp integer ];
+ sig-validity-interval integer [ integer ];
+ transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [
+     dscp integer ];
+ transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * )
+     ] [ dscp integer ];
try-tcp-refresh boolean;
- type ( delegation-only | forward | hint | master | redirect | slave
-     | static-stub | stub );
+ type ( primary | master | secondary | slave | delegation-only |
+     forward | hint | redirect | static-stub | stub );
update-check-ksk boolean;
update-policy ( local | { ( deny | grant ) string ( 6to4-self |
    external | krb5-self | krb5-subdomain | ms-self | ms-subdomain
    | name | self | selfsub | selfwild | subdomain | tcp-self |
-     wildcard | zonesub ) [ string rrtypelist; ... };
+     wildcard | zonesub ) [ string ] rrtypelist; ... };
use-alt-transfer-source boolean;
zero-no-soa-ttl boolean;
zone-statistics ( full | terse | none | boolean );
diff --git a/doc/arm/managed-keys.grammar.xml b/doc/arm/managed-keys.grammar.xml new file mode 100644 index 0000000000..3377a80cb4 --- /dev/null +++ b/doc/arm/managed-keys.grammar.xml @@ -0,0 +1,14 @@ + + + + + +managed-keys { string string integer + integer integer quoted_string; ... }; + diff --git a/doc/arm/master.zoneopt.xml b/doc/arm/master.zoneopt.xml new file mode 100644 index 0000000000..8801e33dc1 --- /dev/null +++ b/doc/arm/master.zoneopt.xml @@ -0,0 +1,66 @@ + + + + +zone string [ class ] { + type ( master | primary ); + allow-query { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + allow-transfer { address_match_element; ... }; + allow-update { address_match_element; ... }; + also-notify [ port integer ] [ dscp integer ] { ( masters | ipv4_address [ port integer ] | ipv6_address [ port integer ] ) [ key string ]; ... }; + alt-transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + auto-dnssec ( allow | maintain | off ); + check-dup-records ( fail | warn | ignore ); + check-integrity boolean; + check-mx ( fail | warn | ignore ); + check-mx-cname ( fail | warn | ignore ); + check-names ( fail | warn | ignore ); + check-sibling boolean; + check-spf ( warn | ignore ); + check-srv-cname ( fail | warn | ignore ); + check-wildcard boolean; + database string; + dialup ( notify | notify-passive | passive | refresh | boolean ); + dlz string; + dnssec-dnskey-kskonly boolean; + dnssec-loadkeys-interval integer; + dnssec-secure-to-insecure boolean; + dnssec-update-mode ( maintain | no-resign ); + file quoted_string; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; + inline-signing boolean; + ixfr-from-differences boolean; + journal quoted_string; + key-directory quoted_string; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + max-journal-size ( default | unlimited | sizeval ); + max-records integer; + max-transfer-idle-out integer; + max-transfer-time-out integer; + max-zone-ttl ( unlimited | ttlval ); + notify ( explicit | master-only | boolean ); + notify-delay integer; + notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + notify-to-soa boolean; + serial-update-method ( date | increment | unixtime ); + sig-signing-nodes integer; + sig-signing-signatures integer; + sig-signing-type integer; + sig-validity-interval integer [ integer ]; + update-check-ksk boolean; + update-policy ( local | { ( deny | grant ) string ( 6to4-self | external | krb5-self | krb5-subdomain | ms-self | ms-subdomain | name | self | selfsub | selfwild | subdomain | tcp-self | wildcard | zonesub ) [ string ] rrtypelist; ... }; + zero-no-soa-ttl boolean; + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/masters.grammar.xml b/doc/arm/masters.grammar.xml new file mode 100644 index 0000000000..f76d9026ac --- /dev/null +++ b/doc/arm/masters.grammar.xml @@ -0,0 +1,16 @@ + + + + + +masters string [ port integer ] [ dscp + integer ] { ( masters | ipv4_address [ + port integer ] | ipv6_address [ port + integer ] ) [ key string ]; ... }; + diff --git a/doc/arm/notes.pdf b/doc/arm/notes.pdf index 6dc2536f1c..663abae8a0 100644 Binary files a/doc/arm/notes.pdf and b/doc/arm/notes.pdf differ diff --git a/doc/arm/options.grammar.xml b/doc/arm/options.grammar.xml new file mode 100644 index 0000000000..d6898e0c1c --- /dev/null +++ b/doc/arm/options.grammar.xml @@ -0,0 +1,305 @@ + + + + + +options { + allow-new-zones boolean; + allow-notify { address_match_element; ... }; + allow-query { address_match_element; ... }; + allow-query-cache { address_match_element; ... }; + allow-query-cache-on { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + allow-recursion { address_match_element; ... }; + allow-recursion-on { address_match_element; ... }; + allow-transfer { address_match_element; ... }; + allow-update { address_match_element; ... }; + allow-update-forwarding { address_match_element; ... }; + also-notify [ port integer ] [ dscp integer ] { ( masters | + ipv4_address [ port integer ] | ipv6_address [ port + integer ] ) [ key string ]; ... }; + alt-transfer-source ( ipv4_address | * ) [ port ( integer | * ) + ] [ dscp integer ]; + alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer | + * ) ] [ dscp integer ]; + attach-cache string; + auth-nxdomain boolean; // default changed + auto-dnssec ( allow | maintain | off ); + automatic-interface-scan boolean; + avoid-v4-udp-ports { portrange; ... }; + avoid-v6-udp-ports { portrange; ... }; + bindkeys-file quoted_string; + blackhole { address_match_element; ... }; + cache-file quoted_string; + catalog-zones { zone quoted_string [ default-masters [ port + integer ] [ dscp integer ] { ( masters | ipv4_address [ + port integer ] | ipv6_address [ port integer ] ) [ key + string ]; ... } ] [ zone-directory quoted_string ] [ + in-memory boolean ] [ min-update-interval integer ]; ... }; + check-dup-records ( fail | warn | ignore ); + check-integrity boolean; + check-mx ( fail | warn | ignore ); + check-mx-cname ( fail | warn | ignore ); + check-names ( primary | master | + secondary | slave | response ) ( + fail | warn | ignore ); + check-sibling boolean; + check-spf ( warn | ignore ); + check-srv-cname ( fail | warn | ignore ); + check-wildcard boolean; + cleaning-interval integer; + clients-per-query integer; + cookie-algorithm ( aes | sha1 | sha256 ); + cookie-secret string; + coresize ( default | unlimited | sizeval ); + datasize ( default | unlimited | sizeval ); + deny-answer-addresses { address_match_element; ... } [ + except-from { quoted_string; ... } ]; + deny-answer-aliases { quoted_string; ... } [ except-from { + quoted_string; ... } ]; + dialup ( notify | notify-passive | passive | refresh | boolean ); + directory quoted_string; + disable-algorithms string { string; + ... }; + disable-ds-digests string { string; + ... }; + disable-empty-zone string; + dns64 netprefix { + break-dnssec boolean; + clients { address_match_element; ... }; + exclude { address_match_element; ... }; + mapped { address_match_element; ... }; + recursive-only boolean; + suffix ipv6_address; + }; + dns64-contact string; + dns64-server string; + dnsrps-enable boolean; + dnsrps-options { unspecified-text }; + dnssec-accept-expired boolean; + dnssec-dnskey-kskonly boolean; + dnssec-enable boolean; + dnssec-loadkeys-interval integer; + dnssec-lookaside ( string trust-anchor + string | auto | no ); + dnssec-must-be-secure string boolean; + dnssec-secure-to-insecure boolean; + dnssec-update-mode ( maintain | no-resign ); + dnssec-validation ( yes | no | auto ); + dnstap { ( all | auth | client | forwarder | + resolver ) [ ( query | response ) ]; ... }; + dnstap-identity ( quoted_string | none | + hostname ); + dnstap-output ( file | unix ) quoted_string [ + size ( unlimited | size ) ] [ versions ( + unlimited | integer ) ] [ suffix ( increment + | timestamp ) ]; + dnstap-version ( quoted_string | none ); + dscp integer; + dual-stack-servers [ port integer ] { ( quoted_string [ port + integer ] [ dscp integer ] | ipv4_address [ port + integer ] [ dscp integer ] | ipv6_address [ port + integer ] [ dscp integer ] ); ... }; + dump-file quoted_string; + edns-udp-size integer; + empty-contact string; + empty-server string; + empty-zones-enable boolean; + fetch-quota-params integer fixedpoint fixedpoint fixedpoint; + fetches-per-server integer [ ( drop | fail ) ]; + fetches-per-zone integer [ ( drop | fail ) ]; + files ( default | unlimited | sizeval ); + filter-aaaa { address_match_element; ... }; + filter-aaaa-on-v4 ( break-dnssec | boolean ); + filter-aaaa-on-v6 ( break-dnssec | boolean ); + flush-zones-on-shutdown boolean; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address + | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; + fstrm-set-buffer-hint integer; + fstrm-set-flush-timeout integer; + fstrm-set-input-queue-size integer; + fstrm-set-output-notify-threshold integer; + fstrm-set-output-queue-model ( mpsc | spsc ); + fstrm-set-output-queue-size integer; + fstrm-set-reopen-interval integer; + geoip-directory ( quoted_string | none ); + geoip-use-ecs boolean; + glue-cache boolean; + heartbeat-interval integer; + hostname ( quoted_string | none ); + inline-signing boolean; + interface-interval integer; + ixfr-from-differences ( primary | master | secondary | slave | + boolean ); + keep-response-order { address_match_element; ... }; + key-directory quoted_string; + lame-ttl ttlval; + listen-on [ port integer ] [ dscp + integer ] { + address_match_element; ... }; + listen-on-v6 [ port integer ] [ dscp + integer ] { + address_match_element; ... }; + lmdb-mapsize sizeval; + lock-file ( quoted_string | none ); + managed-keys-directory quoted_string; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + match-mapped-addresses boolean; + max-cache-size ( default | unlimited | sizeval | percentage ); + max-cache-ttl integer; + max-clients-per-query integer; + max-journal-size ( default | unlimited | sizeval ); + max-ncache-ttl integer; + max-records integer; + max-recursion-depth integer; + max-recursion-queries integer; + max-refresh-time integer; + max-retry-time integer; + max-rsa-exponent-size integer; + max-stale-ttl ttlval; + max-transfer-idle-in integer; + max-transfer-idle-out integer; + max-transfer-time-in integer; + max-transfer-time-out integer; + max-udp-size integer; + max-zone-ttl ( unlimited | ttlval ); + memstatistics boolean; + memstatistics-file quoted_string; + message-compression boolean; + min-refresh-time integer; + min-retry-time integer; + minimal-any boolean; + minimal-responses ( no-auth | no-auth-recursive | boolean ); + multi-master boolean; + new-zones-directory quoted_string; + no-case-compress { address_match_element; ... }; + nocookie-udp-size integer; + notify ( explicit | master-only | boolean ); + notify-delay integer; + notify-rate integer; + notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ + dscp integer ]; + notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] + [ dscp integer ]; + notify-to-soa boolean; + nta-lifetime ttlval; + nta-recheck ttlval; + nxdomain-redirect string; + pid-file ( quoted_string | none ); + port integer; + preferred-glue string; + prefetch integer [ integer ]; + provide-ixfr boolean; + query-source ( ( [ address ] ( ipv4_address | * ) [ port ( + integer | * ) ] ) | ( [ [ address ] ( ipv4_address | * ) ] + port ( integer | * ) ) ) [ dscp integer ]; + query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port ( + integer | * ) ] ) | ( [ [ address ] ( ipv6_address | * ) ] + port ( integer | * ) ) ) [ dscp integer ]; + querylog boolean; + random-device ( quoted_string | none ); + rate-limit { + all-per-second integer; + errors-per-second integer; + exempt-clients { address_match_element; ... }; + ipv4-prefix-length integer; + ipv6-prefix-length integer; + log-only boolean; + max-table-size integer; + min-table-size integer; + nodata-per-second integer; + nxdomains-per-second integer; + qps-scale integer; + referrals-per-second integer; + responses-per-second integer; + slip integer; + window integer; + }; + recursing-file quoted_string; + recursion boolean; + recursive-clients integer; + request-expire boolean; + request-ixfr boolean; + request-nsid boolean; + require-server-cookie boolean; + reserved-sockets integer; + resolver-nonbackoff-tries integer; + resolver-query-timeout integer; + resolver-retry-interval integer; + response-padding { address_match_element; ... } block-size + integer; + response-policy { zone quoted_string [ log boolean ] [ + max-policy-ttl integer ] [ min-update-interval integer ] [ + policy ( cname | disabled | drop | given | no-op | nodata | + nxdomain | passthru | tcp-only quoted_string ) ] [ + recursive-only boolean ] [ nsip-enable boolean ] [ + nsdname-enable boolean ]; ... } [ break-dnssec boolean ] [ + max-policy-ttl integer ] [ min-update-interval integer ] [ + min-ns-dots integer ] [ nsip-wait-recurse boolean ] [ + qname-wait-recurse boolean ] [ recursive-only boolean ] [ + nsip-enable boolean ] [ nsdname-enable boolean ] [ + dnsrps-enable boolean ] [ dnsrps-options { unspecified-text + } ]; + root-delegation-only [ exclude { quoted_string; ... } ]; + rrset-order { [ class string ] [ type string ] [ name + quoted_string ] string string; ... }; + secroots-file quoted_string; + send-cookie boolean; + serial-query-rate integer; + serial-update-method ( date | increment | unixtime ); + server-id ( quoted_string | none | hostname ); + servfail-ttl ttlval; + session-keyalg string; + session-keyfile ( quoted_string | none ); + session-keyname string; + sig-signing-nodes integer; + sig-signing-signatures integer; + sig-signing-type integer; + sig-validity-interval integer [ integer ]; + sortlist { address_match_element; ... }; + stacksize ( default | unlimited | sizeval ); + stale-answer-enable boolean; + stale-answer-ttl ttlval; + startup-notify-rate integer; + statistics-file quoted_string; + synth-from-dnssec boolean; + tcp-advertised-timeout integer; + tcp-clients integer; + tcp-idle-timeout integer; + tcp-initial-timeout integer; + tcp-keepalive-timeout integer; + tcp-listen-queue integer; + tkey-dhkey quoted_string integer; + tkey-domain quoted_string; + tkey-gssapi-credential quoted_string; + tkey-gssapi-keytab quoted_string; + transfer-format ( many-answers | one-answer ); + transfer-message-size integer; + transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ + dscp integer ]; + transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) + ] [ dscp integer ]; + transfers-in integer; + transfers-out integer; + transfers-per-ns integer; + trust-anchor-telemetry boolean; // experimental + try-tcp-refresh boolean; + update-check-ksk boolean; + use-alt-transfer-source boolean; + use-v4-udp-ports { portrange; ... }; + use-v6-udp-ports { portrange; ... }; + v6-bias integer; + version ( quoted_string | none ); + zero-no-soa-ttl boolean; + zero-no-soa-ttl-cache boolean; + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/redirect.zoneopt.xml b/doc/arm/redirect.zoneopt.xml new file mode 100644 index 0000000000..c176558126 --- /dev/null +++ b/doc/arm/redirect.zoneopt.xml @@ -0,0 +1,24 @@ + + + + +zone string [ class ] { + type redirect; + allow-query { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + dlz string; + file quoted_string; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port integer ] [ dscp integer ] { ( masters | ipv4_address [ port integer ] | ipv6_address [ port integer ] ) [ key string ]; ... }; + max-records integer; + max-zone-ttl ( unlimited | ttlval ); + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/server.grammar.xml b/doc/arm/server.grammar.xml new file mode 100644 index 0000000000..b78be9e9fa --- /dev/null +++ b/doc/arm/server.grammar.xml @@ -0,0 +1,44 @@ + + + + + +server netprefix { + bogus boolean; + edns boolean; + edns-udp-size integer; + edns-version integer; + keys server_key; + max-udp-size integer; + notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ + dscp integer ]; + notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] + [ dscp integer ]; + padding integer; + provide-ixfr boolean; + query-source ( ( [ address ] ( ipv4_address | * ) [ port ( + integer | * ) ] ) | ( [ [ address ] ( ipv4_address | * ) ] + port ( integer | * ) ) ) [ dscp integer ]; + query-source-v6 ( ( [ address ] ( ipv6_address | * ) [ port ( + integer | * ) ] ) | ( [ [ address ] ( ipv6_address | * ) ] + port ( integer | * ) ) ) [ dscp integer ]; + request-expire boolean; + request-ixfr boolean; + request-nsid boolean; + send-cookie boolean; + tcp-keepalive boolean; + tcp-only boolean; + transfer-format ( many-answers | one-answer ); + transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ + dscp integer ]; + transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) + ] [ dscp integer ]; + transfers integer; +}; + diff --git a/doc/arm/slave.zoneopt.xml b/doc/arm/slave.zoneopt.xml new file mode 100644 index 0000000000..b305787931 --- /dev/null +++ b/doc/arm/slave.zoneopt.xml @@ -0,0 +1,69 @@ + + + + +zone string [ class ] { + type ( slave | secondary ); + allow-notify { address_match_element; ... }; + allow-query { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + allow-transfer { address_match_element; ... }; + allow-update-forwarding { address_match_element; ... }; + also-notify [ port integer ] [ dscp integer ] { ( masters | ipv4_address [ port integer ] | ipv6_address [ port integer ] ) [ key string ]; ... }; + alt-transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + alt-transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + auto-dnssec ( allow | maintain | off ); + check-names ( fail | warn | ignore ); + database string; + dialup ( notify | notify-passive | passive | refresh | boolean ); + dlz string; + dnssec-dnskey-kskonly boolean; + dnssec-loadkeys-interval integer; + dnssec-update-mode ( maintain | no-resign ); + file quoted_string; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; + inline-signing boolean; + ixfr-from-differences boolean; + journal quoted_string; + key-directory quoted_string; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port integer ] [ dscp integer ] { ( masters | ipv4_address [ port integer ] | ipv6_address [ port integer ] ) [ key string ]; ... }; + max-journal-size ( default | unlimited | sizeval ); + max-records integer; + max-refresh-time integer; + max-retry-time integer; + max-transfer-idle-in integer; + max-transfer-idle-out integer; + max-transfer-time-in integer; + max-transfer-time-out integer; + min-refresh-time integer; + min-retry-time integer; + multi-master boolean; + notify ( explicit | master-only | boolean ); + notify-delay integer; + notify-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + notify-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + notify-to-soa boolean; + request-expire boolean; + request-ixfr boolean; + sig-signing-nodes integer; + sig-signing-signatures integer; + sig-signing-type integer; + sig-validity-interval integer [ integer ]; + transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + try-tcp-refresh boolean; + update-check-ksk boolean; + use-alt-transfer-source boolean; + zero-no-soa-ttl boolean; + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/static-stub.zoneopt.xml b/doc/arm/static-stub.zoneopt.xml new file mode 100644 index 0000000000..6571a8075f --- /dev/null +++ b/doc/arm/static-stub.zoneopt.xml @@ -0,0 +1,22 @@ + + + + +zone string [ class ] { + type static-stub; + allow-query { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; + max-records integer; + server-addresses { ( ipv4_address | ipv6_address ) [ port integer ]; ... }; + server-names { quoted_string; ... }; + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/statistics-channels.grammar.xml b/doc/arm/statistics-channels.grammar.xml new file mode 100644 index 0000000000..a50f32152c --- /dev/null +++ b/doc/arm/statistics-channels.grammar.xml @@ -0,0 +1,18 @@ + + + + + +statistics-channels { + inet ( ipv4_address | ipv6_address | + * ) [ port ( integer | * ) ] [ + allow { address_match_element; ... + } ]; +}; + diff --git a/doc/arm/stub.zoneopt.xml b/doc/arm/stub.zoneopt.xml new file mode 100644 index 0000000000..ccd038ffdb --- /dev/null +++ b/doc/arm/stub.zoneopt.xml @@ -0,0 +1,38 @@ + + + + +zone string [ class ] { + type stub; + allow-query { address_match_element; ... }; + allow-query-on { address_match_element; ... }; + check-names ( fail | warn | ignore ); + database string; + delegation-only boolean; + dialup ( notify | notify-passive | passive | refresh | boolean ); + file quoted_string; + forward ( first | only ); + forwarders [ port integer ] [ dscp integer ] { ( ipv4_address | ipv6_address ) [ port integer ] [ dscp integer ]; ... }; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port integer ] [ dscp integer ] { ( masters | ipv4_address [ port integer ] | ipv6_address [ port integer ] ) [ key string ]; ... }; + max-records integer; + max-refresh-time integer; + max-retry-time integer; + max-transfer-idle-in integer; + max-transfer-time-in integer; + min-refresh-time integer; + min-retry-time integer; + multi-master boolean; + transfer-source ( ipv4_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + transfer-source-v6 ( ipv6_address | * ) [ port ( integer | * ) ] [ dscp integer ]; + use-alt-transfer-source boolean; + zone-statistics ( full | terse | none | boolean ); +}; + diff --git a/doc/arm/trusted-keys.grammar.xml b/doc/arm/trusted-keys.grammar.xml new file mode 100644 index 0000000000..2e7da28a7b --- /dev/null +++ b/doc/arm/trusted-keys.grammar.xml @@ -0,0 +1,14 @@ + + + + + +trusted-keys { string integer integer + integer quoted_string; ... }; + diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index b3a1f68d3b..5ee27a7e31 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -30,6 +30,15 @@ options: FORCE if test -x ${CFG_TEST} ; \ then \ ${CFG_TEST} --named --grammar > $@.raw ; \ + ${CFG_TEST} --zonegrammar master > master.zoneopt ; \ + ${CFG_TEST} --zonegrammar slave > slave.zoneopt ; \ + ${CFG_TEST} --zonegrammar forward > forward.zoneopt ; \ + ${CFG_TEST} --zonegrammar hint > hint.zoneopt ; \ + ${CFG_TEST} --zonegrammar stub > stub.zoneopt ; \ + ${CFG_TEST} --zonegrammar static-stub > static-stub.zoneopt ; \ + ${CFG_TEST} --zonegrammar redirect > redirect.zoneopt ; \ + ${CFG_TEST} --zonegrammar delegation-only > delegation-only.zoneopt ; \ + ${CFG_TEST} --zonegrammar in-view > in-view.zoneopt ; \ ${PERL} ${srcdir}/sort-options.pl < $@.raw > $@.sorted ; \ ${PERL} ${srcdir}/format-options.pl < $@.sorted > $@.new ; \ mv -f $@.new $@ ; \ @@ -40,3 +49,22 @@ options: FORCE docbook: options ${PERL} docbook-options.pl options > ${top_srcdir}/bin/named/named.conf.docbook + ${PERL} docbook-zoneopt.pl master.zoneopt > ${top_srcdir}/doc/arm/master.zoneopt.xml + ${PERL} docbook-zoneopt.pl slave.zoneopt > ${top_srcdir}/doc/arm/slave.zoneopt.xml + ${PERL} docbook-zoneopt.pl forward.zoneopt > ${top_srcdir}/doc/arm/forward.zoneopt.xml + ${PERL} docbook-zoneopt.pl hint.zoneopt > ${top_srcdir}/doc/arm/hint.zoneopt.xml + ${PERL} docbook-zoneopt.pl stub.zoneopt > ${top_srcdir}/doc/arm/stub.zoneopt.xml + ${PERL} docbook-zoneopt.pl static-stub.zoneopt > ${top_srcdir}/doc/arm/static-stub.zoneopt.xml + ${PERL} docbook-zoneopt.pl redirect.zoneopt > ${top_srcdir}/doc/arm/redirect.zoneopt.xml + ${PERL} docbook-zoneopt.pl delegation-only.zoneopt > ${top_srcdir}/doc/arm/delegation-only.zoneopt.xml + ${PERL} docbook-zoneopt.pl in-view.zoneopt > ${top_srcdir}/doc/arm/in-view.zoneopt.xml + ${PERL} docbook-grammars.pl options acl > ${top_srcdir}/doc/arm/acl.grammar.xml + ${PERL} docbook-grammars.pl options controls > ${top_srcdir}/doc/arm/controls.grammar.xml + ${PERL} docbook-grammars.pl options key > ${top_srcdir}/doc/arm/key.grammar.xml + ${PERL} docbook-grammars.pl options logging > ${top_srcdir}/doc/arm/logging.grammar.xml + ${PERL} docbook-grammars.pl options masters > ${top_srcdir}/doc/arm/masters.grammar.xml + ${PERL} docbook-grammars.pl options options > ${top_srcdir}/doc/arm/options.grammar.xml + ${PERL} docbook-grammars.pl options server > ${top_srcdir}/doc/arm/server.grammar.xml + ${PERL} docbook-grammars.pl options statistics-channels > ${top_srcdir}/doc/arm/statistics-channels.grammar.xml + ${PERL} docbook-grammars.pl options trusted-keys > ${top_srcdir}/doc/arm/trusted-keys.grammar.xml + ${PERL} docbook-grammars.pl options managed-keys > ${top_srcdir}/doc/arm/managed-keys.grammar.xml diff --git a/doc/misc/delegation-only.zoneopt b/doc/misc/delegation-only.zoneopt new file mode 100644 index 0000000000..ab86327cbd --- /dev/null +++ b/doc/misc/delegation-only.zoneopt @@ -0,0 +1,3 @@ +zone [ ] { + type delegation-only; +}; diff --git a/doc/misc/docbook-grammars.pl b/doc/misc/docbook-grammars.pl new file mode 100644 index 0000000000..95620b2eff --- /dev/null +++ b/doc/misc/docbook-grammars.pl @@ -0,0 +1,82 @@ +#!/usr/bin/perl +# +# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +use warnings; +use strict; +use Time::Piece; + +if (@ARGV < 2) { + print STDERR <<'END'; +usage: + perl docbook-options.pl options_file section > section.grammar.xml +END + exit 1; +} + +my $FILE = shift; +my $SECTION = shift; + +open (FH, "<", $FILE) or die "Can't open $FILE"; + +my $t = Time::Piece->new(); +my $year = $t->year; + +print < + + + + +END + +# skip preamble +my $preamble = 0; +while () { + if (m{^\s*$}) { + last if $preamble > 0; + } else { + $preamble++; + } +} + +my $display = 0; +while () { + if (m{^$SECTION\b}) { + $display = 1 + } + + if (m{// not.*implemented} || m{// obsolete} || m{// test.*only}) { + next; + } + + s{ // not configured}{}; + s{ // non-operational}{}; + s{ // may occur multiple times}{}; + s{<([a-z0-9_-]+)>}{$1}g; + s{^(\s*)([a-z0-9_-]+)\b}{$1$2}; + s{[[]}{[}g; + s{[]]}{]}g; + s{ }{\t}g; + + if (m{^\s*$} && $display) { + last; + } + if ($display) { + print; + } +} + +print < +END diff --git a/doc/misc/docbook-options.pl b/doc/misc/docbook-options.pl index 9b78fd5ea4..75b775f78b 100644 --- a/doc/misc/docbook-options.pl +++ b/doc/misc/docbook-options.pl @@ -122,6 +122,7 @@ while () { } s{ // not configured}{}; + s{ // non-operational}{}; s{ // may occur multiple times}{}; s{<([a-z0-9_-]+)>}{$1}g; s{[[]}{[}g; diff --git a/doc/misc/docbook-zoneopt.pl b/doc/misc/docbook-zoneopt.pl new file mode 100644 index 0000000000..900dddf53f --- /dev/null +++ b/doc/misc/docbook-zoneopt.pl @@ -0,0 +1,61 @@ +#!/usr/bin/perl +# +# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +use warnings; +use strict; +use Time::Piece; + +if (@ARGV < 1) { + print STDERR <<'END'; +usage: + perl docbook-zoneopt.pl zoneopt_file [YYYY] +END + exit 1; +} + +my $FILE = shift; + +my $t = Time::Piece->new(); +my $year; +$year = `git log --max-count=1 --date=format:%Y --format='%cd' -- $FILE` or $year = $t->year; +chomp $year; + +open (FH, "<", $FILE) or die "Can't open $FILE"; + +print < + + + +END + +while () { + if (m{// not.*implemented} || m{// obsolete} || m{// test.*only}) { + next; + } + + s{ // not configured}{}; + s{ // may occur multiple times}{}; + s{<([a-z0-9_-]+)>}{$1}g; + s{^(\s*)([a-z0-9_-]+)\b}{$1$2}; + s{[[]}{[}g; + s{[]]}{]}g; + s{ }{\t}g; + + print; +} + +print < +END diff --git a/doc/misc/forward.zoneopt b/doc/misc/forward.zoneopt new file mode 100644 index 0000000000..e694813a86 --- /dev/null +++ b/doc/misc/forward.zoneopt @@ -0,0 +1,6 @@ +zone [ ] { + type forward; + delegation-only ; + forward ( first | only ); + forwarders [ port ] [ dscp ] { ( | ) [ port ] [ dscp ]; ... }; +}; diff --git a/doc/misc/hint.zoneopt b/doc/misc/hint.zoneopt new file mode 100644 index 0000000000..d7ec16c739 --- /dev/null +++ b/doc/misc/hint.zoneopt @@ -0,0 +1,6 @@ +zone [ ] { + type hint; + check-names ( fail | warn | ignore ); + delegation-only ; + file ; +}; diff --git a/doc/misc/in-view.zoneopt b/doc/misc/in-view.zoneopt new file mode 100644 index 0000000000..c63c4273e5 --- /dev/null +++ b/doc/misc/in-view.zoneopt @@ -0,0 +1,3 @@ +zone [ ] { + in-view ; +}; diff --git a/doc/misc/master.zoneopt b/doc/misc/master.zoneopt new file mode 100644 index 0000000000..7bec788bb6 --- /dev/null +++ b/doc/misc/master.zoneopt @@ -0,0 +1,56 @@ +zone [ ] { + type ( master | primary ); + allow-query { ; ... }; + allow-query-on { ; ... }; + allow-transfer { ; ... }; + allow-update { ; ... }; + also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ]; ... }; + alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; + alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + auto-dnssec ( allow | maintain | off ); + check-dup-records ( fail | warn | ignore ); + check-integrity ; + check-mx ( fail | warn | ignore ); + check-mx-cname ( fail | warn | ignore ); + check-names ( fail | warn | ignore ); + check-sibling ; + check-spf ( warn | ignore ); + check-srv-cname ( fail | warn | ignore ); + check-wildcard ; + database ; + dialup ( notify | notify-passive | passive | refresh | ); + dlz ; + dnssec-dnskey-kskonly ; + dnssec-loadkeys-interval ; + dnssec-secure-to-insecure ; + dnssec-update-mode ( maintain | no-resign ); + file ; + forward ( first | only ); + forwarders [ port ] [ dscp ] { ( | ) [ port ] [ dscp ]; ... }; + inline-signing ; + ixfr-from-differences ; + journal ; + key-directory ; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + max-journal-size ( default | unlimited | ); + max-records ; + max-transfer-idle-out ; + max-transfer-time-out ; + max-zone-ttl ( unlimited | ); + notify ( explicit | master-only | ); + notify-delay ; + notify-source ( | * ) [ port ( | * ) ] [ dscp ]; + notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + notify-to-soa ; + nsec3-test-zone ; // test only + serial-update-method ( date | increment | unixtime ); + sig-signing-nodes ; + sig-signing-signatures ; + sig-signing-type ; + sig-validity-interval [ ]; + update-check-ksk ; + update-policy ( local | { ( deny | grant ) ( 6to4-self | external | krb5-self | krb5-subdomain | ms-self | ms-subdomain | name | self | selfsub | selfwild | subdomain | tcp-self | wildcard | zonesub ) [ ] ; ... }; + zero-no-soa-ttl ; + zone-statistics ( full | terse | none | ); +}; diff --git a/doc/misc/redirect.zoneopt b/doc/misc/redirect.zoneopt new file mode 100644 index 0000000000..a127de9bbf --- /dev/null +++ b/doc/misc/redirect.zoneopt @@ -0,0 +1,13 @@ +zone [ ] { + type redirect; + allow-query { ; ... }; + allow-query-on { ; ... }; + dlz ; + file ; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ]; ... }; + max-records ; + max-zone-ttl ( unlimited | ); + zone-statistics ( full | terse | none | ); +}; diff --git a/doc/misc/slave.zoneopt b/doc/misc/slave.zoneopt new file mode 100644 index 0000000000..a9e62a4503 --- /dev/null +++ b/doc/misc/slave.zoneopt @@ -0,0 +1,59 @@ +zone [ ] { + type ( slave | secondary ); + allow-notify { ; ... }; + allow-query { ; ... }; + allow-query-on { ; ... }; + allow-transfer { ; ... }; + allow-update-forwarding { ; ... }; + also-notify [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ]; ... }; + alt-transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; + alt-transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + auto-dnssec ( allow | maintain | off ); + check-names ( fail | warn | ignore ); + database ; + dialup ( notify | notify-passive | passive | refresh | ); + dlz ; + dnssec-dnskey-kskonly ; + dnssec-loadkeys-interval ; + dnssec-update-mode ( maintain | no-resign ); + file ; + forward ( first | only ); + forwarders [ port ] [ dscp ] { ( | ) [ port ] [ dscp ]; ... }; + inline-signing ; + ixfr-from-differences ; + journal ; + key-directory ; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ]; ... }; + max-journal-size ( default | unlimited | ); + max-records ; + max-refresh-time ; + max-retry-time ; + max-transfer-idle-in ; + max-transfer-idle-out ; + max-transfer-time-in ; + max-transfer-time-out ; + min-refresh-time ; + min-retry-time ; + multi-master ; + notify ( explicit | master-only | ); + notify-delay ; + notify-source ( | * ) [ port ( | * ) ] [ dscp ]; + notify-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + notify-to-soa ; + nsec3-test-zone ; // test only + request-expire ; + request-ixfr ; + sig-signing-nodes ; + sig-signing-signatures ; + sig-signing-type ; + sig-validity-interval [ ]; + transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; + transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + try-tcp-refresh ; + update-check-ksk ; + use-alt-transfer-source ; + zero-no-soa-ttl ; + zone-statistics ( full | terse | none | ); +}; diff --git a/doc/misc/static-stub.zoneopt b/doc/misc/static-stub.zoneopt new file mode 100644 index 0000000000..74abe0b137 --- /dev/null +++ b/doc/misc/static-stub.zoneopt @@ -0,0 +1,11 @@ +zone [ ] { + type static-stub; + allow-query { ; ... }; + allow-query-on { ; ... }; + forward ( first | only ); + forwarders [ port ] [ dscp ] { ( | ) [ port ] [ dscp ]; ... }; + max-records ; + server-addresses { ( | ) [ port ]; ... }; + server-names { ; ... }; + zone-statistics ( full | terse | none | ); +}; diff --git a/doc/misc/stub.zoneopt b/doc/misc/stub.zoneopt new file mode 100644 index 0000000000..b18b102912 --- /dev/null +++ b/doc/misc/stub.zoneopt @@ -0,0 +1,27 @@ +zone [ ] { + type stub; + allow-query { ; ... }; + allow-query-on { ; ... }; + check-names ( fail | warn | ignore ); + database ; + delegation-only ; + dialup ( notify | notify-passive | passive | refresh | ); + file ; + forward ( first | only ); + forwarders [ port ] [ dscp ] { ( | ) [ port ] [ dscp ]; ... }; + masterfile-format ( map | raw | text ); + masterfile-style ( full | relative ); + masters [ port ] [ dscp ] { ( | [ port ] | [ port ] ) [ key ]; ... }; + max-records ; + max-refresh-time ; + max-retry-time ; + max-transfer-idle-in ; + max-transfer-time-in ; + min-refresh-time ; + min-retry-time ; + multi-master ; + transfer-source ( | * ) [ port ( | * ) ] [ dscp ]; + transfer-source-v6 ( | * ) [ port ( | * ) ] [ dscp ]; + use-alt-transfer-source ; + zone-statistics ( full | terse | none | ); +}; diff --git a/lib/bind9/check.c b/lib/bind9/check.c index 0645cc44cc..b11de10edc 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c @@ -46,6 +46,8 @@ #include #include +#include +#include #include @@ -1799,17 +1801,6 @@ check_update_policy(const cfg_obj_t *policy, isc_log_t *logctx) { return (result); } -#define MASTERZONE 1 -#define SLAVEZONE 2 -#define STUBZONE 4 -#define HINTZONE 8 -#define FORWARDZONE 16 -#define DELEGATIONZONE 32 -#define STATICSTUBZONE 64 -#define REDIRECTZONE 128 -#define STREDIRECTZONE 0 /* Set to REDIRECTZONE to allow xfr-in. */ -#define CHECKACL 512 - typedef struct { const char *name; int allowed; @@ -1863,82 +1854,20 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, isc_boolean_t dlz; dns_masterformat_t masterformat; isc_boolean_t ddns = ISC_FALSE; - - static optionstable options[] = { - { "allow-notify", SLAVEZONE | CHECKACL }, - { "allow-query", MASTERZONE | SLAVEZONE | STUBZONE | REDIRECTZONE | - CHECKACL | STATICSTUBZONE }, - { "allow-transfer", MASTERZONE | SLAVEZONE | CHECKACL }, - { "allow-update", MASTERZONE | CHECKACL }, - { "allow-update-forwarding", SLAVEZONE | CHECKACL }, - { "also-notify", MASTERZONE | SLAVEZONE }, - { "auto-dnssec", MASTERZONE | SLAVEZONE }, - { "check-dup-records", MASTERZONE }, - { "check-mx", MASTERZONE }, - { "check-mx-cname", MASTERZONE }, - { "check-srv-cname", MASTERZONE }, - { "check-wildcard", MASTERZONE }, - { "database", MASTERZONE | SLAVEZONE | STUBZONE | REDIRECTZONE }, - { "delegation-only", HINTZONE | STUBZONE | FORWARDZONE | - DELEGATIONZONE }, - { "dialup", MASTERZONE | SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "dnssec-dnskey-kskonly", MASTERZONE | SLAVEZONE }, - { "dnssec-loadkeys-interval", MASTERZONE | SLAVEZONE }, - { "dnssec-secure-to-insecure", MASTERZONE }, - { "file", MASTERZONE | SLAVEZONE | STUBZONE | HINTZONE | REDIRECTZONE }, - { "forward", MASTERZONE | SLAVEZONE | STUBZONE | STATICSTUBZONE | - FORWARDZONE }, - { "forwarders", MASTERZONE | SLAVEZONE | STUBZONE | STATICSTUBZONE | - FORWARDZONE }, - { "integrity-check", MASTERZONE }, - { "ixfr-base", MASTERZONE | SLAVEZONE }, - { "ixfr-tmp-file", MASTERZONE | SLAVEZONE }, - { "journal", MASTERZONE | SLAVEZONE | STREDIRECTZONE }, - { "key-directory", MASTERZONE | SLAVEZONE }, - { "maintain-ixfr-base", MASTERZONE | SLAVEZONE | STREDIRECTZONE }, - { "masterfile-format", MASTERZONE | SLAVEZONE | STUBZONE | - REDIRECTZONE }, - { "masters", SLAVEZONE | STUBZONE | REDIRECTZONE }, - { "max-ixfr-log-size", MASTERZONE | SLAVEZONE | STREDIRECTZONE }, - { "max-records", MASTERZONE | SLAVEZONE | STUBZONE | STREDIRECTZONE | - STATICSTUBZONE | REDIRECTZONE }, - { "max-refresh-time", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "max-retry-time", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "max-transfer-idle-in", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "max-transfer-idle-out", MASTERZONE | SLAVEZONE }, - { "max-transfer-time-in", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "max-transfer-time-out", MASTERZONE | SLAVEZONE }, - { "max-zone-ttl", MASTERZONE | REDIRECTZONE }, - { "min-refresh-time", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "min-retry-time", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "notify", MASTERZONE | SLAVEZONE }, - { "notify-source", MASTERZONE | SLAVEZONE }, - { "notify-source-v6", MASTERZONE | SLAVEZONE }, - { "pubkey", MASTERZONE | SLAVEZONE | STUBZONE }, - { "request-expire", SLAVEZONE | REDIRECTZONE }, - { "request-ixfr", SLAVEZONE | REDIRECTZONE }, - { "server-addresses", STATICSTUBZONE }, - { "server-names", STATICSTUBZONE }, - { "sig-re-signing-interval", MASTERZONE | SLAVEZONE }, - { "sig-signing-nodes", MASTERZONE | SLAVEZONE }, - { "sig-signing-signatures", MASTERZONE | SLAVEZONE }, - { "sig-signing-type", MASTERZONE | SLAVEZONE }, - { "sig-validity-interval", MASTERZONE | SLAVEZONE }, - { "signing", MASTERZONE | SLAVEZONE }, - { "transfer-source", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "transfer-source-v6", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "try-tcp-refresh", SLAVEZONE | STREDIRECTZONE }, - { "update-check-ksk", MASTERZONE | SLAVEZONE }, - { "update-policy", MASTERZONE }, - { "zone-statistics", MASTERZONE | SLAVEZONE | STUBZONE | - STATICSTUBZONE | REDIRECTZONE }, + const void *clauses = NULL; + const char *option = NULL; + static const char *acls[] = { + "allow-notify", + "allow-transfer", + "allow-update", + "allow-update-forwarding", }; static optionstable dialups[] = { - { "notify", MASTERZONE | SLAVEZONE | STREDIRECTZONE }, - { "notify-passive", SLAVEZONE | STREDIRECTZONE }, - { "passive", SLAVEZONE | STUBZONE | STREDIRECTZONE }, - { "refresh", SLAVEZONE | STUBZONE | STREDIRECTZONE }, + { "notify", CFG_ZONE_MASTER | CFG_ZONE_SLAVE }, + { "notify-passive", CFG_ZONE_SLAVE }, + { "passive", CFG_ZONE_SLAVE | CFG_ZONE_STUB }, + { "refresh", CFG_ZONE_SLAVE | CFG_ZONE_STUB }, }; znamestr = cfg_obj_asstring(cfg_tuple_get(zconfig, "name")); @@ -1979,30 +1908,30 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, } typestr = cfg_obj_asstring(obj); - if (strcasecmp(typestr, "master") == 0) - ztype = MASTERZONE; - else if (strcasecmp(typestr, "slave") == 0) - ztype = SLAVEZONE; - else if (strcasecmp(typestr, "stub") == 0) - ztype = STUBZONE; - else if (strcasecmp(typestr, "static-stub") == 0) - ztype = STATICSTUBZONE; - else if (strcasecmp(typestr, "forward") == 0) - ztype = FORWARDZONE; - else if (strcasecmp(typestr, "hint") == 0) - ztype = HINTZONE; - else if (strcasecmp(typestr, "delegation-only") == 0) - ztype = DELEGATIONZONE; - else if (strcasecmp(typestr, "redirect") == 0) - ztype = REDIRECTZONE; - else { + if (strcasecmp(typestr, "master") == 0) { + ztype = CFG_ZONE_MASTER; + } else if (strcasecmp(typestr, "slave") == 0) { + ztype = CFG_ZONE_SLAVE; + } else if (strcasecmp(typestr, "stub") == 0) { + ztype = CFG_ZONE_STUB; + } else if (strcasecmp(typestr, "static-stub") == 0) { + ztype = CFG_ZONE_STATICSTUB; + } else if (strcasecmp(typestr, "forward") == 0) { + ztype = CFG_ZONE_FORWARD; + } else if (strcasecmp(typestr, "hint") == 0) { + ztype = CFG_ZONE_HINT; + } else if (strcasecmp(typestr, "delegation-only") == 0) { + ztype = CFG_ZONE_DELEGATION; + } else if (strcasecmp(typestr, "redirect") == 0) { + ztype = CFG_ZONE_REDIRECT; + } else { cfg_obj_log(obj, logctx, ISC_LOG_ERROR, "zone '%s': invalid type %s", znamestr, typestr); return (ISC_R_FAILURE); } - if (ztype == REDIRECTZONE && strcmp(znamestr, ".") != 0) { + if (ztype == CFG_ZONE_REDIRECT && strcmp(znamestr, ".") != 0) { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, "redirect zones must be called \".\""); return (ISC_R_FAILURE); @@ -2048,8 +1977,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, zname = dns_fixedname_name(&fixedname); dns_name_format(zname, namebuf, sizeof(namebuf)); - tresult = nameexist(zconfig, namebuf, ztype == HINTZONE ? 1 : - ztype == REDIRECTZONE ? 2 : 3, + tresult = nameexist(zconfig, namebuf, + ztype == CFG_ZONE_HINT ? 1 : + ztype == CFG_ZONE_REDIRECT ? 2 : 3, symtab, "zone '%s': already exists " "previous definition: %s:%u", logctx, mctx); if (tresult != ISC_R_SUCCESS) @@ -2069,47 +1999,39 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, result = ISC_R_FAILURE; /* - * Look for inappropriate options for the given zone type. + * Check validity of the zone options. + */ + option = cfg_map_firstclause(&cfg_type_zoneopts, &clauses, &i); + while (option != NULL) { + obj = NULL; + if (cfg_map_get(zoptions, option, &obj) == ISC_R_SUCCESS && + obj != NULL && !cfg_clause_validforzone(option, ztype)) + { + cfg_obj_log(obj, logctx, ISC_LOG_WARNING, + "option '%s' is not allowed " + "in '%s' zone '%s'", + option, typestr, znamestr); + result = ISC_R_FAILURE; + } + option = cfg_map_nextclause(&cfg_type_zoneopts, &clauses, &i); + } + + /* * Check that ACLs expand correctly. */ - for (i = 0; i < sizeof(options) / sizeof(options[0]); i++) { - obj = NULL; - if ((options[i].allowed & ztype) == 0 && - cfg_map_get(zoptions, options[i].name, &obj) == - ISC_R_SUCCESS) - { - if (strcmp(options[i].name, "allow-update") != 0 || - ztype != SLAVEZONE) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "option '%s' is not allowed " - "in '%s' zone '%s'", - options[i].name, typestr, - znamestr); - result = ISC_R_FAILURE; - } else - cfg_obj_log(obj, logctx, ISC_LOG_WARNING, - "option '%s' is not allowed " - "in '%s' zone '%s'", - options[i].name, typestr, - znamestr); + for (i = 0; i < (sizeof(acls) / sizeof(acls[0])); i++) { + tresult = checkacl(acls[i], actx, zconfig, + voptions, config, logctx, mctx); + if (tresult != ISC_R_SUCCESS) { + result = tresult; } - obj = NULL; - if ((options[i].allowed & ztype) != 0 && - (options[i].allowed & CHECKACL) != 0) { - - tresult = checkacl(options[i].name, actx, zconfig, - voptions, config, logctx, mctx); - if (tresult != ISC_R_SUCCESS) - result = tresult; - } - } /* * Master & slave zones may have an "also-notify" field, but * shouldn't if notify is disabled. */ - if (ztype == MASTERZONE || ztype == SLAVEZONE ) { + if (ztype == CFG_ZONE_MASTER || ztype == CFG_ZONE_SLAVE) { isc_boolean_t donotify = ISC_TRUE; obj = NULL; @@ -2123,7 +2045,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, donotify = cfg_obj_asboolean(obj); else { const char *notifystr = cfg_obj_asstring(obj); - if (ztype != MASTERZONE && + if (ztype != CFG_ZONE_MASTER && strcasecmp(notifystr, "master-only") == 0) donotify = ISC_FALSE; } @@ -2152,7 +2074,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, /* * Slave & stub zones must have a "masters" field. */ - if (ztype == SLAVEZONE || ztype == STUBZONE) { + if (ztype == CFG_ZONE_SLAVE || ztype == CFG_ZONE_STUB) { obj = NULL; if (cfg_map_get(zoptions, "masters", &obj) != ISC_R_SUCCESS) { cfg_obj_log(zoptions, logctx, ISC_LOG_ERROR, @@ -2177,7 +2099,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, /* * Master zones can't have both "allow-update" and "update-policy". */ - if (ztype == MASTERZONE || ztype == SLAVEZONE) { + if (ztype == CFG_ZONE_MASTER || ztype == CFG_ZONE_SLAVE) { isc_boolean_t signing = ISC_FALSE; isc_result_t res1, res2, res3; const cfg_obj_t *au = NULL; @@ -2242,7 +2164,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, "'auto-dnssec %s;' requires%s " "inline-signing to be configured for " "the zone", arg, - (ztype == MASTERZONE) ? + (ztype == CFG_ZONE_MASTER) ? " dynamic DNS or" : ""); result = ISC_R_FAILURE; } @@ -2261,7 +2183,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, obj = NULL; res1 = cfg_map_get(zoptions, "dnssec-dnskey-kskonly", &obj); - if (res1 == ISC_R_SUCCESS && ztype == SLAVEZONE && !signing) { + if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SLAVE && + !signing) + { cfg_obj_log(obj, logctx, ISC_LOG_ERROR, "dnssec-dnskey-kskonly: requires " "inline-signing when used in slave zone"); @@ -2270,7 +2194,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, obj = NULL; res1 = cfg_map_get(zoptions, "dnssec-loadkeys-interval", &obj); - if (res1 == ISC_R_SUCCESS && ztype == SLAVEZONE && !signing) { + if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SLAVE && + !signing) + { cfg_obj_log(obj, logctx, ISC_LOG_ERROR, "dnssec-loadkeys-interval: requires " "inline-signing when used in slave zone"); @@ -2279,7 +2205,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, obj = NULL; res1 = cfg_map_get(zoptions, "update-check-ksk", &obj); - if (res1 == ISC_R_SUCCESS && ztype == SLAVEZONE && !signing) { + if (res1 == ISC_R_SUCCESS && ztype == CFG_ZONE_SLAVE && + !signing) + { cfg_obj_log(obj, logctx, ISC_LOG_ERROR, "update-check-ksk: requires " "inline-signing when used in slave zone"); @@ -2290,7 +2218,9 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, /* * Check the excessively complicated "dialup" option. */ - if (ztype == MASTERZONE || ztype == SLAVEZONE || ztype == STUBZONE) { + if (ztype == CFG_ZONE_MASTER || ztype == CFG_ZONE_SLAVE || + ztype == CFG_ZONE_STUB) + { const cfg_obj_t *dialup = NULL; (void)cfg_map_get(zoptions, "dialup", &dialup); if (dialup != NULL && cfg_obj_isstring(dialup)) { @@ -2338,7 +2268,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, * Check that a RFC 1918 / ULA reverse zone is not forward first * unless explictly configured to be so. */ - if (ztype == FORWARDZONE && (rfc1918 || ula)) { + if (ztype == CFG_ZONE_FORWARD && (rfc1918 || ula)) { obj = NULL; (void)cfg_map_get(zoptions, "forward", &obj); if (obj == NULL) { @@ -2365,7 +2295,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, */ obj = NULL; (void)cfg_map_get(zoptions, "server-addresses", &obj); - if (ztype == STATICSTUBZONE && obj != NULL) { + if (ztype == CFG_ZONE_STATICSTUB && obj != NULL) { for (element = cfg_list_first(obj); element != NULL; element = cfg_list_next(element)) @@ -2398,7 +2328,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, */ obj = NULL; (void)cfg_map_get(zoptions, "server-names", &obj); - if (zname != NULL && ztype == STATICSTUBZONE && obj != NULL) { + if (zname != NULL && ztype == CFG_ZONE_STATICSTUB && obj != NULL) { for (element = cfg_list_first(obj); element != NULL; element = cfg_list_next(element)) @@ -2534,20 +2464,23 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions, obj = NULL; res1 = cfg_map_get(zoptions, "inline-signing", &obj); if ((tresult != ISC_R_SUCCESS && - (ztype == MASTERZONE || ztype == HINTZONE || - (ztype == SLAVEZONE && res1 == ISC_R_SUCCESS && - cfg_obj_asboolean(obj))))) { + (ztype == CFG_ZONE_MASTER || ztype == CFG_ZONE_HINT || + (ztype == CFG_ZONE_SLAVE && res1 == ISC_R_SUCCESS && + cfg_obj_asboolean(obj))))) + { cfg_obj_log(zconfig, logctx, ISC_LOG_ERROR, "zone '%s': missing 'file' entry", znamestr); result = tresult; } else if (tresult == ISC_R_SUCCESS && - (ztype == SLAVEZONE || ddns)) { + (ztype == CFG_ZONE_SLAVE || ddns)) { tresult = fileexist(fileobj, files, ISC_TRUE, logctx); if (tresult != ISC_R_SUCCESS) result = tresult; } else if (tresult == ISC_R_SUCCESS && - (ztype == MASTERZONE || ztype == HINTZONE)) { + (ztype == CFG_ZONE_MASTER || + ztype == CFG_ZONE_HINT)) + { tresult = fileexist(fileobj, files, ISC_FALSE, logctx); if (tresult != ISC_R_SUCCESS) result = tresult; diff --git a/lib/isccfg/include/isccfg/cfg.h b/lib/isccfg/include/isccfg/cfg.h index b60b628f7f..94dec54675 100644 --- a/lib/isccfg/include/isccfg/cfg.h +++ b/lib/isccfg/include/isccfg/cfg.h @@ -6,8 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: cfg.h,v 1.46 2010/08/13 23:47:04 tbox Exp $ */ - #ifndef ISCCFG_CFG_H #define ISCCFG_CFG_H 1 @@ -538,6 +536,13 @@ cfg_obj_line(const cfg_obj_t *obj); * Return the line in file where this object was defined. */ +const char * +cfg_map_firstclause(const cfg_type_t *map, const void **clauses, + unsigned int *idx); +const char * +cfg_map_nextclause(const cfg_type_t *map, const void **clauses, + unsigned int *idx); + ISC_LANG_ENDDECLS #endif /* ISCCFG_CFG_H */ diff --git a/lib/isccfg/include/isccfg/grammar.h b/lib/isccfg/include/isccfg/grammar.h index 364f3dbacb..1257f2ea61 100644 --- a/lib/isccfg/include/isccfg/grammar.h +++ b/lib/isccfg/include/isccfg/grammar.h @@ -6,8 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: grammar.h,v 1.24 2011/01/04 23:47:14 tbox Exp $ */ - #ifndef ISCCFG_GRAMMAR_H #define ISCCFG_GRAMMAR_H 1 @@ -52,6 +50,21 @@ * compile time options, but is harmless. */ #define CFG_CLAUSEFLAG_NOOP 0x00000200 +/*% + * Zone types for which a clause is valid: + * These share space with CFG_CLAUSEFLAG values, but count + * down from the top. + */ +#define CFG_ZONE_MASTER 0x80000000 +#define CFG_ZONE_SLAVE 0x40000000 +#define CFG_ZONE_STUB 0x20000000 +#define CFG_ZONE_HINT 0x10000000 +#define CFG_ZONE_FORWARD 0x08000000 +#define CFG_ZONE_STATICSTUB 0x04000000 +#define CFG_ZONE_REDIRECT 0x02000000 +#define CFG_ZONE_DELEGATION 0x01000000 +#define CFG_ZONE_INVIEW 0x00800000 + typedef struct cfg_clausedef cfg_clausedef_t; typedef struct cfg_tuplefielddef cfg_tuplefielddef_t; typedef struct cfg_printer cfg_printer_t; @@ -507,4 +520,32 @@ isc_boolean_t cfg_is_enum(const char *s, const char *const *enums); /*%< Return true iff the string 's' is one of the strings in 'enums' */ +isc_boolean_t +cfg_clause_validforzone(const char *name, unsigned int ztype); +/*%< + * Check whether an option is legal for the specified zone type. + */ + +void +cfg_print_zonegrammar(const unsigned int zonetype, + void (*f)(void *closure, const char *text, int textlen), + void *closure); +/*%< + * Print a summary of the grammar of the zone type represented by + * 'zonetype'. + */ + +void +cfg_print_clauseflags(cfg_printer_t *pctx, unsigned int flags); +/*%< + * Print clause flags (e.g. "obsolete", "not implemented", etc) in + * human readable form + */ + +void +cfg_print_indent(cfg_printer_t *pctx); +/*%< + * Print the necessary indent required by the current settings of 'pctx'. + */ + #endif /* ISCCFG_GRAMMAR_H */ diff --git a/lib/isccfg/include/isccfg/namedconf.h b/lib/isccfg/include/isccfg/namedconf.h index 74f0f38f11..b5c3150c9c 100644 --- a/lib/isccfg/include/isccfg/namedconf.h +++ b/lib/isccfg/include/isccfg/namedconf.h @@ -48,4 +48,7 @@ LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_keyref; /*%< An EDNS client subnet address, used as an ACL element */ LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_ecsprefix; +/*%< Zone options */ +LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_zoneopts; + #endif /* ISCCFG_NAMEDCONF_H */ diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index e84ea17bb9..22c5f78350 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -24,6 +24,7 @@ #include #include #include +#include #define TOKEN_STRING(pctx) (pctx->token.value.as_textregion.base) @@ -141,7 +142,6 @@ static cfg_type_t cfg_type_ttlval; static cfg_type_t cfg_type_view; static cfg_type_t cfg_type_viewopts; static cfg_type_t cfg_type_zone; -static cfg_type_t cfg_type_zoneopts; /*% tkey-dhkey */ @@ -1998,106 +1998,280 @@ static cfg_type_t cfg_type_validityinterval = { /*% * Clauses that can be found in a 'zone' statement, * with defaults in the 'view' or 'options' statement. + * + * Note: CFG_ZONE_* options indicate in which zone types this clause is + * legal. */ 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 }, - { "also-notify", &cfg_type_namesockaddrkeylist, 0 }, - { "alt-transfer-source", &cfg_type_sockaddr4wild, 0 }, - { "alt-transfer-source-v6", &cfg_type_sockaddr6wild, 0 }, - { "auto-dnssec", &cfg_type_autodnssec, 0 }, - { "check-dup-records", &cfg_type_checkmode, 0 }, - { "check-integrity", &cfg_type_boolean, 0 }, - { "check-mx", &cfg_type_checkmode, 0 }, - { "check-mx-cname", &cfg_type_checkmode, 0 }, - { "check-sibling", &cfg_type_boolean, 0 }, - { "check-spf", &cfg_type_warn, 0 }, - { "check-srv-cname", &cfg_type_checkmode, 0 }, - { "check-wildcard", &cfg_type_boolean, 0 }, - { "dialup", &cfg_type_dialuptype, 0 }, - { "dnssec-dnskey-kskonly", &cfg_type_boolean, 0 }, - { "dnssec-loadkeys-interval", &cfg_type_uint32, 0 }, - { "dnssec-secure-to-insecure", &cfg_type_boolean, 0 }, - { "dnssec-update-mode", &cfg_type_dnssecupdatemode, 0 }, - { "forward", &cfg_type_forwardtype, 0 }, - { "forwarders", &cfg_type_portiplist, 0 }, - { "inline-signing", &cfg_type_boolean, 0 }, - { "key-directory", &cfg_type_qstring, 0 }, - { "maintain-ixfr-base", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, - { "masterfile-format", &cfg_type_masterformat, 0 }, - { "masterfile-style", &cfg_type_masterstyle, 0 }, - { "max-ixfr-log-size", &cfg_type_size, CFG_CLAUSEFLAG_OBSOLETE }, - { "max-journal-size", &cfg_type_size, 0 }, - { "max-records", &cfg_type_uint32, 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 }, - { "max-zone-ttl", &cfg_type_maxttl, 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 }, - { "nsec3-test-zone", &cfg_type_boolean, CFG_CLAUSEFLAG_TESTONLY }, - { "request-expire", &cfg_type_boolean, 0 }, - { "request-ixfr", &cfg_type_boolean, 0 }, - { "serial-update-method", &cfg_type_updatemethod, 0 }, - { "sig-signing-nodes", &cfg_type_uint32, 0 }, - { "sig-signing-signatures", &cfg_type_uint32, 0 }, - { "sig-signing-type", &cfg_type_uint32, 0 }, - { "sig-validity-interval", &cfg_type_validityinterval, 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_zonestat, 0 }, + { "allow-notify", &cfg_type_bracketed_aml, + CFG_ZONE_SLAVE + }, + { "allow-query", &cfg_type_bracketed_aml, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_REDIRECT | CFG_ZONE_STATICSTUB + }, + { "allow-query-on", &cfg_type_bracketed_aml, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_REDIRECT | CFG_ZONE_STATICSTUB + }, + { "allow-transfer", &cfg_type_bracketed_aml, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "allow-update", &cfg_type_bracketed_aml, + CFG_ZONE_MASTER + }, + { "allow-update-forwarding", &cfg_type_bracketed_aml, + CFG_ZONE_SLAVE + }, + { "also-notify", &cfg_type_namesockaddrkeylist, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "alt-transfer-source", &cfg_type_sockaddr4wild, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "alt-transfer-source-v6", &cfg_type_sockaddr6wild, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "auto-dnssec", &cfg_type_autodnssec, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "check-dup-records", &cfg_type_checkmode, + CFG_ZONE_MASTER + }, + { "check-integrity", &cfg_type_boolean, + CFG_ZONE_MASTER + }, + { "check-mx", &cfg_type_checkmode, + CFG_ZONE_MASTER + }, + { "check-mx-cname", &cfg_type_checkmode, + CFG_ZONE_MASTER + }, + { "check-sibling", &cfg_type_boolean, + CFG_ZONE_MASTER + }, + { "check-spf", &cfg_type_warn, + CFG_ZONE_MASTER + }, + { "check-srv-cname", &cfg_type_checkmode, + CFG_ZONE_MASTER + }, + { "check-wildcard", &cfg_type_boolean, + CFG_ZONE_MASTER + }, + { "dialup", &cfg_type_dialuptype, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "dnssec-dnskey-kskonly", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "dnssec-loadkeys-interval", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "dnssec-secure-to-insecure", &cfg_type_boolean, + CFG_ZONE_MASTER + }, + { "dnssec-update-mode", &cfg_type_dnssecupdatemode, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "forward", &cfg_type_forwardtype, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_STATICSTUB | CFG_ZONE_FORWARD + }, + { "forwarders", &cfg_type_portiplist, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_STATICSTUB | CFG_ZONE_FORWARD + }, + { "inline-signing", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "key-directory", &cfg_type_qstring, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "maintain-ixfr-base", &cfg_type_boolean, + CFG_CLAUSEFLAG_OBSOLETE + }, + { "masterfile-format", &cfg_type_masterformat, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | + CFG_ZONE_STUB | CFG_ZONE_REDIRECT + }, + { "masterfile-style", &cfg_type_masterstyle, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | + CFG_ZONE_STUB | CFG_ZONE_REDIRECT + }, + { "max-ixfr-log-size", &cfg_type_size, + CFG_CLAUSEFLAG_OBSOLETE + }, + { "max-journal-size", &cfg_type_size, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "max-records", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT + }, + { "max-refresh-time", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "max-retry-time", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "max-transfer-idle-in", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "max-transfer-idle-out", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "max-transfer-time-in", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "max-transfer-time-out", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "max-zone-ttl", &cfg_type_maxttl, + CFG_ZONE_MASTER | CFG_ZONE_REDIRECT + }, + { "min-refresh-time", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "min-retry-time", &cfg_type_uint32, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "multi-master", &cfg_type_boolean, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "notify", &cfg_type_notifytype, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "notify-delay", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "notify-source", &cfg_type_sockaddr4wild, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "notify-source-v6", &cfg_type_sockaddr6wild, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "notify-to-soa", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "nsec3-test-zone", &cfg_type_boolean, + CFG_CLAUSEFLAG_TESTONLY | + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "request-expire", &cfg_type_boolean, + CFG_ZONE_SLAVE + }, + { "request-ixfr", &cfg_type_boolean, + CFG_ZONE_SLAVE + }, + { "serial-update-method", &cfg_type_updatemethod, + CFG_ZONE_MASTER + }, + { "sig-signing-nodes", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "sig-signing-signatures", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "sig-signing-type", &cfg_type_uint32, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "sig-validity-interval", &cfg_type_validityinterval, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "transfer-source", &cfg_type_sockaddr4wild, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "transfer-source-v6", &cfg_type_sockaddr6wild, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "try-tcp-refresh", &cfg_type_boolean, + CFG_ZONE_SLAVE + }, + { "update-check-ksk", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "use-alt-transfer-source", &cfg_type_boolean, + CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "zero-no-soa-ttl", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "zone-statistics", &cfg_type_zonestat, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT + }, { NULL, NULL, 0 } }; /*% - * Clauses that can be found in a 'zone' statement - * only. + * Clauses that can be found in a 'zone' statement only. + * + * Note: CFG_ZONE_* options indicate in which zone types this clause is + * legal. */ static cfg_clausedef_t zone_only_clauses[] = { - { "type", &cfg_type_zonetype, 0 }, - { "file", &cfg_type_qstring, 0 }, - { "journal", &cfg_type_qstring, 0 }, - { "ixfr-base", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, - { "ixfr-tmp-file", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, - { "masters", &cfg_type_namesockaddrkeylist, 0 }, - { "pubkey", &cfg_type_pubkey, - CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OBSOLETE }, - { "update-policy", &cfg_type_updatepolicy, 0 }, - { "database", &cfg_type_astring, 0 }, - { "dlz", &cfg_type_astring, 0 }, - { "delegation-only", &cfg_type_boolean, 0 }, /* * Note that the format of the check-names option is different between * the zone options and the global/view options. Ugh. */ - { "check-names", &cfg_type_checkmode, 0 }, - { "in-view", &cfg_type_astring, 0 }, - { "ixfr-from-differences", &cfg_type_boolean, 0 }, - { "server-addresses", &cfg_type_bracketed_sockaddrlist, 0 }, - { "server-names", &cfg_type_namelist, 0 }, + { "check-names", &cfg_type_checkmode, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | + CFG_ZONE_HINT | CFG_ZONE_STUB + }, + { "database", &cfg_type_astring, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB + }, + { "delegation-only", &cfg_type_boolean, + CFG_ZONE_HINT | CFG_ZONE_STUB | CFG_ZONE_FORWARD + }, + { "dlz", &cfg_type_astring, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_REDIRECT + }, + { "file", &cfg_type_qstring, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_HINT | CFG_ZONE_REDIRECT + }, + { "in-view", &cfg_type_astring, + CFG_ZONE_INVIEW + }, + { "ixfr-base", &cfg_type_qstring, + CFG_CLAUSEFLAG_OBSOLETE + }, + { "ixfr-from-differences", &cfg_type_boolean, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "ixfr-tmp-file", &cfg_type_qstring, + CFG_CLAUSEFLAG_OBSOLETE + }, + { "journal", &cfg_type_qstring, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE + }, + { "masters", &cfg_type_namesockaddrkeylist, + CFG_ZONE_SLAVE | CFG_ZONE_STUB | CFG_ZONE_REDIRECT + }, + { "pubkey", &cfg_type_pubkey, + CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OBSOLETE + }, + { "server-addresses", &cfg_type_bracketed_sockaddrlist, + CFG_ZONE_STATICSTUB + }, + { "server-names", &cfg_type_namelist, + CFG_ZONE_STATICSTUB + }, + { "type", &cfg_type_zonetype, + CFG_ZONE_MASTER | CFG_ZONE_SLAVE | CFG_ZONE_STUB | + CFG_ZONE_STATICSTUB | CFG_ZONE_DELEGATION | CFG_ZONE_HINT | + CFG_ZONE_REDIRECT | CFG_ZONE_FORWARD + }, + { "update-policy", &cfg_type_updatepolicy, + CFG_ZONE_MASTER + }, { NULL, NULL, 0 } }; - /*% The top-level named.conf syntax. */ static cfg_clausedef_t * @@ -2160,7 +2334,7 @@ zone_clausesets[] = { zone_clauses, NULL }; -static cfg_type_t cfg_type_zoneopts = { +LIBISCCFG_EXTERNAL_DATA cfg_type_t cfg_type_zoneopts = { "zoneopts", cfg_parse_map, cfg_print_map, cfg_doc_map, &cfg_rep_map, zone_clausesets }; @@ -3861,3 +4035,118 @@ static cfg_type_t cfg_type_maxttl = { "maxttl_no_default", parse_maxttl, cfg_print_ustring, doc_maxttl, &cfg_rep_string, maxttl_enums }; + +static int cmp_clause(const void *ap, const void *bp) { + const cfg_clausedef_t *a = (const cfg_clausedef_t *)ap; + const cfg_clausedef_t *b = (const cfg_clausedef_t *)bp; + return (strcmp(a->name, b->name)); +} + +isc_boolean_t +cfg_clause_validforzone(const char *name, unsigned int ztype) { + const cfg_clausedef_t *clause; + isc_boolean_t valid = ISC_FALSE; + + for (clause = zone_clauses; clause->name != NULL; clause++) { + if ((clause->flags & ztype) == 0 || + strcmp(clause->name, name) != 0) + { + continue; + } + valid = ISC_TRUE; + } + for (clause = zone_only_clauses; clause->name != NULL; clause++) { + if ((clause->flags & ztype) == 0 || + strcmp(clause->name, name) != 0) + { + continue; + } + valid = ISC_TRUE; + } + + return (valid); +} + +void +cfg_print_zonegrammar(const unsigned int zonetype, + void (*f)(void *closure, const char *text, int textlen), + void *closure) +{ +#define NCLAUSES \ + (((sizeof(zone_clauses) + sizeof(zone_only_clauses)) / \ + sizeof(clause[0])) - 1) + + cfg_printer_t pctx; + cfg_clausedef_t *clause = NULL; + cfg_clausedef_t clauses[NCLAUSES]; + + pctx.f = f; + pctx.closure = closure; + pctx.indent = 0; + pctx.flags = 0; + + memmove(clauses, zone_clauses, sizeof(zone_clauses)); + memmove(clauses + sizeof(zone_clauses)/sizeof(zone_clauses[0]) - 1, + zone_only_clauses, sizeof(zone_only_clauses)); + qsort(clauses, NCLAUSES - 1, sizeof(clause[0]), cmp_clause); + + cfg_print_cstr(&pctx, "zone [ ] {\n"); + pctx.indent++; + + switch (zonetype) { + case CFG_ZONE_MASTER: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type ( master | primary );\n"); + break; + case CFG_ZONE_SLAVE: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type ( slave | secondary );\n"); + break; + case CFG_ZONE_STUB: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type stub;\n"); + break; + case CFG_ZONE_HINT: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type hint;\n"); + break; + case CFG_ZONE_FORWARD: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type forward;\n"); + break; + case CFG_ZONE_STATICSTUB: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type static-stub;\n"); + break; + case CFG_ZONE_REDIRECT: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type redirect;\n"); + break; + case CFG_ZONE_DELEGATION: + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, "type delegation-only;\n"); + break; + case CFG_ZONE_INVIEW: + /* no zone type is specified for these */ + break; + default: + INSIST(0); + } + + for (clause = clauses; clause->name != NULL; clause++) { + if ((clause->flags & zonetype) == 0 || + strcasecmp(clause->name, "type") == 0) { + continue; + } + cfg_print_indent(&pctx); + cfg_print_cstr(&pctx, clause->name); + cfg_print_cstr(&pctx, " "); + cfg_doc_obj(&pctx, clause->type); + cfg_print_cstr(&pctx, ";"); + cfg_print_clauseflags(&pctx, clause->flags); + cfg_print_cstr(&pctx, "\n"); + } + + pctx.indent--; + cfg_print_cstr(&pctx, "};\n"); +} diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 6d15e0c953..eb84363915 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -157,8 +157,8 @@ print_open(cfg_printer_t *pctx) { } } -static void -print_indent(cfg_printer_t *pctx) { +void +cfg_print_indent(cfg_printer_t *pctx) { int indent = pctx->indent; if ((pctx->flags & CFG_PRINTER_ONELINE) != 0) { cfg_print_cstr(pctx, " "); @@ -174,7 +174,7 @@ static void print_close(cfg_printer_t *pctx) { if ((pctx->flags & CFG_PRINTER_ONELINE) == 0) { pctx->indent--; - print_indent(pctx); + cfg_print_indent(pctx); } cfg_print_cstr(pctx, "}"); } @@ -1467,7 +1467,7 @@ print_list(cfg_printer_t *pctx, const cfg_obj_t *obj) { cfg_print_obj(pctx, elt->obj); cfg_print_cstr(pctx, "; "); } else { - print_indent(pctx); + cfg_print_indent(pctx); cfg_print_obj(pctx, elt->obj); cfg_print_cstr(pctx, ";\n"); } @@ -1909,7 +1909,7 @@ cfg_parse_netprefix_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t ** static void print_symval(cfg_printer_t *pctx, const char *name, cfg_obj_t *obj) { if ((pctx->flags & CFG_PRINTER_ONELINE) == 0) - print_indent(pctx); + cfg_print_indent(pctx); cfg_print_cstr(pctx, name); cfg_print_cstr(pctx, " "); @@ -1984,8 +1984,8 @@ static struct flagtext { { 0, NULL } }; -static void -print_clause_flags(cfg_printer_t *pctx, unsigned int flags) { +void +cfg_print_clauseflags(cfg_printer_t *pctx, unsigned int flags) { struct flagtext *p; isc_boolean_t first = ISC_TRUE; for (p = flagtexts; p->flag != 0; p++) { @@ -2009,14 +2009,12 @@ cfg_doc_mapbody(cfg_printer_t *pctx, const cfg_type_t *type) { REQUIRE(type != NULL); for (clauseset = type->of; *clauseset != NULL; clauseset++) { - for (clause = *clauseset; - clause->name != NULL; - clause++) { + for (clause = *clauseset; clause->name != NULL; clause++) { cfg_print_cstr(pctx, clause->name); cfg_print_cstr(pctx, " "); cfg_doc_obj(pctx, clause->type); cfg_print_cstr(pctx, ";"); - print_clause_flags(pctx, clause->flags); + cfg_print_clauseflags(pctx, clause->flags); cfg_print_cstr(pctx, "\n\n"); } } @@ -2058,16 +2056,14 @@ cfg_doc_map(cfg_printer_t *pctx, const cfg_type_t *type) { print_open(pctx); for (clauseset = type->of; *clauseset != NULL; clauseset++) { - for (clause = *clauseset; - clause->name != NULL; - clause++) { - print_indent(pctx); + for (clause = *clauseset; clause->name != NULL; clause++) { + cfg_print_indent(pctx); cfg_print_cstr(pctx, clause->name); if (clause->type->print != cfg_print_void) cfg_print_cstr(pctx, " "); cfg_doc_obj(pctx, clause->type); cfg_print_cstr(pctx, ";"); - print_clause_flags(pctx, clause->flags); + cfg_print_clauseflags(pctx, clause->flags); cfg_print_cstr(pctx, "\n"); } } @@ -2115,6 +2111,55 @@ cfg_map_count(const cfg_obj_t *mapobj) { return (isc_symtab_count(map->symtab)); } +const char * +cfg_map_firstclause(const cfg_type_t *map, const void **clauses, + unsigned int *idx) +{ + cfg_clausedef_t * const * clauseset; + + REQUIRE(map != NULL && map->rep == &cfg_rep_map); + REQUIRE(idx != NULL); + REQUIRE(clauses != NULL && *clauses == NULL); + + clauseset = map->of; + if (*clauseset == NULL) { + return (NULL); + } + *clauses = *clauseset; + *idx = 0; + while ((*clauseset)[*idx].name == NULL) { + *clauses = (*++clauseset); + if (*clauses == NULL) + return (NULL); + } + return ((*clauseset)[*idx].name); +} + +const char * +cfg_map_nextclause(const cfg_type_t *map, const void **clauses, + unsigned int *idx) +{ + cfg_clausedef_t * const * clauseset; + + REQUIRE(map != NULL && map->rep == &cfg_rep_map); + REQUIRE(idx != NULL); + REQUIRE(clauses != NULL && *clauses != NULL); + + clauseset = map->of; + while (*clauseset != NULL && *clauseset != *clauses) { + clauseset++; + } + INSIST(*clauseset == *clauses); + (*idx)++; + while ((*clauseset)[*idx].name == NULL) { + *idx = 0; + *clauses = (*++clauseset); + if (*clauses == NULL) + return (NULL); + } + return ((*clauseset)[*idx].name); +} + /* Parse an arbitrary token, storing its raw text representation. */ static isc_result_t parse_token(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { diff --git a/lib/isccfg/tests/parser_test.c b/lib/isccfg/tests/parser_test.c index 175492675a..8f42c4aa0d 100644 --- a/lib/isccfg/tests/parser_test.c +++ b/lib/isccfg/tests/parser_test.c @@ -134,10 +134,56 @@ ATF_TC_BODY(parse_buffer, tc) { cleanup(); } +ATF_TC(cfg_map_firstclause); +ATF_TC_HEAD(cfg_map_firstclause, tc) { + atf_tc_set_md_var(tc, "descr", "cfg_map_firstclause"); +} +ATF_TC_BODY(cfg_map_firstclause, tc) { + const char *name = NULL; + const void *clauses = NULL; + unsigned int idx; + + UNUSED(tc); + + name = cfg_map_firstclause(&cfg_type_zoneopts, &clauses, &idx); + ATF_CHECK(name != NULL); + ATF_CHECK(clauses != NULL); + ATF_CHECK_EQ(idx, 0); +} + +ATF_TC(cfg_map_nextclause); +ATF_TC_HEAD(cfg_map_nextclause, tc) { + atf_tc_set_md_var(tc, "descr", "cfg_map_firstclause"); +} +ATF_TC_BODY(cfg_map_nextclause, tc) { + const char *name = NULL; + const void *clauses = NULL; + unsigned int idx; + + UNUSED(tc); + + name = cfg_map_firstclause(&cfg_type_zoneopts, &clauses, &idx); + ATF_REQUIRE(name != NULL); + ATF_REQUIRE(clauses != NULL); + ATF_REQUIRE_EQ(idx, ISC_R_SUCCESS); + + do { + name = cfg_map_nextclause(&cfg_type_zoneopts, &clauses, &idx); + if (name != NULL) { + ATF_CHECK(clauses != NULL); + } else { + ATF_CHECK_EQ(clauses, NULL); + ATF_CHECK_EQ(idx, 0); + } + } while (name != NULL); +} + /* * Main */ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, parse_buffer); + ATF_TP_ADD_TC(tp, cfg_map_firstclause); + ATF_TP_ADD_TC(tp, cfg_map_nextclause); return (atf_no_error()); }