LINUX, BIND9
I have a network which sits in /21 block and would like to make a reverse zone, I would like some guidance to know where to look to create the reverse zone file.
I could make seperate files for each of the 3rd octet block, example: 0.168.192.in-addr.arpa.zone + 1.168.192.in-addr.arpa.zone +.... 7.168.192.in-addr.arpa.zone. But how would I combine this into one file and put all the PTR records in the same place?
1 Answer
Create a zone like you would for any other host/domain.
Lets call it 1.168.192.in-addr.arpa.zone:
$TTL 3600
$ORIGIN 1.168.192.in-addr.arpa.
@ IN SOA primary.domain.name. root.localhost. ( 2016010220 ; Serial 3600 ; Refresh (1hr) 300 ; Retry (15min) 3600000 ; Expire (5 weeks 6 days 16 hours) 3600 ) ; Minimum (1hr)
; authoritative servers IN NS primary.domain.name. IN NS secondary.server.name. IN NS slave.dome.domain. IN NS ... IN NS ...
; RRs
1.1.168.192.in-addr.arpa. IN PTR host.domain.name.
2.1.168.192.in-addr.arpa. IN PTR nameserver.some.domain.
3.1.168.192.in-addr.arpa. IN PTR another.host.name.
...
253.1.168.192.in-addr.arpa. IN PTR mx.mail.exchange.
254.1.168.192.in-addr.arpa. IN PTR web.server.domain.Then list it as you would any other zone in your named.conf file.
That's really all you need.
EDIT:
It occurs to me based on your respnse in the comments section that you might not be familiar with CIDR notation
Here's a CIDR calculator from the authority on Internet Numbers (ARIN).
As such. Here's another way to describe an entire block of (IP) 256 addresses:
192.168.1.0/24The notation is the same as described above. But you're now able to "group" blocks of varying quantity in each delegation.
You can also describe "blocks" of IP addresses thusly:
0-256 IN NS master.some.domainor
1.0-3.0.168.192.in-addr.arpa IN PTR host.domain.name.In your RR glue (as above).
See also The BIND Administration Guide for the proprietary $GENERATE macro for creating sequences of PTR records (assumes a "classfull" list).
Lastly, an RFC2317 example you might find helpful
$ORIGIN 2.0.192.in-addr.arpa.
@ IN SOA my-ns.my.domain. hostmaster.my.domain. (...)
;...
; <<0-127>> /25
0/25 NS ns.A.domain.
0/25 NS some.other.name.server.
;
1 CNAME 1.0/25.2.0.192.in-addr.arpa.
2 CNAME 2.0/25.2.0.192.in-addr.arpa.
3 CNAME 3.0/25.2.0.192.in-addr.arpa.
;
; <<128-191>> /26
128/26 NS ns.B.domain.
128/26 NS some.other.name.server.too.
;
129 CNAME 129.128/26.2.0.192.in-addr.arpa.
130 CNAME 130.128/26.2.0.192.in-addr.arpa.
131 CNAME 131.128/26.2.0.192.in-addr.arpa.
;
; <<192-255>> /26
192/26 NS ns.C.domain.
192/26 NS some.other.third.name.server.
;
193 CNAME 193.192/26.2.0.192.in-addr.arpa.
194 CNAME 194.192/26.2.0.192.in-addr.arpa.
195 CNAME 195.192/26.2.0.192.in-addr.arpa.
$ORIGIN 0/25.2.0.192.in-addr.arpa.
@ IN SOA ns.A.domain. hostmaster.A.domain. (...)
@ NS ns.A.domain.
@ NS some.other.name.server.
;
1 PTR host1.A.domain.
2 PTR host2.A.domain.
3 PTR host3.A.domain.HTH
2