RFC2317 (BCP20) describes a way to delegate a reverse DNS zone for non-octet prefixes (i.e. different than /8, /16, and /24). Effectively, it makes it possible to delegate chunks of a /24 to small clients.
We will show an example of how to delegate the reverse DNS zone for the first /26 of 203.0.113.0/24 where both parent and child zones use BIND9 authoritative DNS server.
1. Configuration for the DNS parent zone#
Edit the zone file that you wish to delegate, in our case it's /var/named/113.0.203.in-addr.arpa :
/var/named/113.0.203.in-addr.arpa$ORIGIN 113.0.203.in-addr.arpa.
;
; Delegation of 0/26.113.0.203.in-addr.arpa to Client X
;
0/26 IN NS ns1.clientx.ma.
0/26 IN NS ns2.clientx.ma.
1 IN CNAME 1.0/26.113.0.203.in-addr.arpa.
2 IN CNAME 2.0/26.113.0.203.in-addr.arpa.
.
.
63 IN CNAME 63.0/26.113.0.203.in-addr.arpa.
2. Configuration on the client's side#
On the client's side, create a file containing the child zone, in our example /var/named/0-63.113.0.203.in-addr.arpa
/var/named/0-63.113.0.203.in-addr.arpa$ORIGIN 0/26.113.0.203.in-addr.arpa.
@ IN SOA ns1.clientx.ma. root.clientx.ma. (
2019081000 ; serial
3600 ; refresh (1 hour)
900 ; retry (15 min)
604800 ; expire (1 week 0 days 0 hours)
86000 ; minimum (1 day)
)
NS ns1.clientx.ma.
NS ns2.clientx.ma.
1 IN PTR ns1.clientx.ma.
40 IN PTR mail.clientx.ma.
62 IN PTR www.clientx.ma.
Then add the child zone just created to the client's BIND DNS configuration. In our example we'll add the zone 0/26.113.0.203.in-addr.arpa to /etc/name.conf like follow:
/etc/named.conf
zone "0/26.113.0.203.in-addr.arpa" {
type master;
file "/var/named/0-63.113.0.203.in-addr.arpa";
};