]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #1344: RFC6761-reserved domains: test. and invalid.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 11 Jul 2017 13:27:33 +0000 (13:27 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 11 Jul 2017 13:27:33 +0000 (13:27 +0000)
git-svn-id: file:///svn/unbound/trunk@4272 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
doc/example.conf.in
doc/unbound.conf.5.in
services/localzone.c

index f132b550128afb52f4a8004c4209d801a1ed1e14..9b62c75740e6a2b1048e5948a0726de1d8a6e522 100644 (file)
@@ -1,3 +1,6 @@
+11 July 2017: Wouter
+       - Fix #1344: RFC6761-reserved domains: test. and invalid.
+
 6 July 2017: Wouter
        - Fix tests to use .tdir (from Manu Bretelle) instead of .tpkg.
        - Fix svn hooks for tdir (selected if testcode/mini_tdir.sh exists)..
index 13c373f8f7d92bced3ef2b9a3289c89e9f687f61..657ee54de7f6a3cdc2932185d2dcfd37cb74a5ac 100644 (file)
@@ -563,6 +563,8 @@ server:
        # local-zone: "127.in-addr.arpa." nodefault
        # local-zone: "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa." nodefault
        # local-zone: "onion." nodefault
+       # local-zone: "test." nodefault
+       # local-zone: "invalid." nodefault
        # local-zone: "10.in-addr.arpa." nodefault
        # local-zone: "16.172.in-addr.arpa." nodefault
        # local-zone: "17.172.in-addr.arpa." nodefault
index 721cd3d76d3261556e56382c7c683d12ec2c9ff0..fc9d054efbbe5c93b24209654e3b781fd4ff09b6 100644 (file)
@@ -1048,13 +1048,13 @@ has no other effect than turning off default contents for the
 given zone.  Use \fInodefault\fR if you use exactly that zone, if you want to
 use a subzone, use \fItransparent\fR.
 .P
-The default zones are localhost, reverse 127.0.0.1 and ::1, the onion and
-the AS112 zones. The AS112 zones are reverse DNS zones for private use and
-reserved IP addresses for which the servers on the internet cannot provide
-correct answers. They are configured by default to give nxdomain (no reverse
-information) answers. The defaults can be turned off by specifying your
-own local\-zone of that name, or using the 'nodefault' type. Below is a
-list of the default zone contents.
+The default zones are localhost, reverse 127.0.0.1 and ::1, the onion, test,
+invalid and the AS112 zones. The AS112 zones are reverse DNS zones for
+private use and reserved IP addresses for which the servers on the internet
+cannot provide correct answers. They are configured by default to give
+nxdomain (no reverse information) answers. The defaults can be turned off
+by specifying your own local\-zone of that name, or using the 'nodefault'
+type. Below is a list of the default zone contents.
 .TP 10
 \h'5'\fIlocalhost\fR
 The IP4 and IP6 localhost information is given. NS and SOA records are provided
@@ -1104,6 +1104,24 @@ local\-data: "onion. 10800 IN
     SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
 .fi
 .TP 10
+\h'5'\fItest (RFC 7686)\fR
+Default content:
+.nf
+local\-zone: "test." static
+local\-data: "test. 10800 IN NS localhost."
+local\-data: "test. 10800 IN
+    SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
+.fi
+.TP 10
+\h'5'\fIinvalid (RFC 7686)\fR
+Default content:
+.nf
+local\-zone: "invalid." static
+local\-data: "invalid. 10800 IN NS localhost."
+local\-data: "invalid. 10800 IN
+    SOA localhost. nobody.invalid. 1 3600 1200 604800 10800"
+.fi
+.TP 10
 \h'5'\fIreverse RFC1918 local use zones\fR
 Reverse data for zones 10.in\-addr.arpa, 16.172.in\-addr.arpa to
 31.172.in\-addr.arpa, 168.192.in\-addr.arpa.
index a19b5252643f3b538bd02a73a56a9667d59feed3..d0c7c08f46474d916135e5607e9fb35b63950891 100644 (file)
@@ -719,9 +719,9 @@ lz_nodefault(struct config_file* cfg, const char* name)
        return 0;
 }
 
-/** enter AS112 default zone */
+/** enter (AS112) empty default zone */
 static int
-add_as112_default(struct local_zones* zones, struct config_file* cfg,
+add_empty_default(struct local_zones* zones, struct config_file* cfg,
         const char* name)
 {
        struct local_zone* z;
@@ -816,26 +816,24 @@ int local_zone_enter_defaults(struct local_zones* zones, struct config_file* cfg
                lock_rw_unlock(&z->lock);
        }
        /* onion. zone (RFC 7686) */
-       if(!lz_exists(zones, "onion.") &&
-               !lz_nodefault(cfg, "onion.")) {
-               if(!(z=lz_enter_zone(zones, "onion.", "static", 
-                       LDNS_RR_CLASS_IN)) ||
-                  !lz_enter_rr_into_zone(z,
-                       "onion. 10800 IN NS localhost.") ||
-                  !lz_enter_rr_into_zone(z,
-                       "onion. 10800 IN SOA localhost. nobody.invalid. "
-                       "1 3600 1200 604800 10800")) {
-                       log_err("out of memory adding default zone");
-                       if(z) { lock_rw_unlock(&z->lock); }
-                       return 0;
-               }
-               lock_rw_unlock(&z->lock);
+       if(!add_empty_default(zones, cfg, "onion.")) {
+               log_err("out of memory adding default zone");
+               return 0;
+       }
+       /* test. zone (RFC 7686) */
+       if(!add_empty_default(zones, cfg, "test.")) {
+               log_err("out of memory adding default zone");
+               return 0;
+       }
+       /* invalid. zone (RFC 7686) */
+       if(!add_empty_default(zones, cfg, "invalid.")) {
+               log_err("out of memory adding default zone");
+               return 0;
        }
-
        /* block AS112 zones, unless asked not to */
        if(!cfg->unblock_lan_zones) {
                for(zstr = as112_zones; *zstr; zstr++) {
-                       if(!add_as112_default(zones, cfg, *zstr)) {
+                       if(!add_empty_default(zones, cfg, *zstr)) {
                                log_err("out of memory adding default zone");
                                return 0;
                        }