Linux – How to find out the serial number of a reverse zone in bind

bindlinuxunix

Is there a way to extract the actual serial number in effect for a reverse zone from a bind9 server?.

I can find out the domain's serial, but have no idea how to do the same for the reverse zones.

This is to find the serial for the my example.com domain (set up in example.zone in bind9):

# dig +nocmd example.com  any +multiline +noall +answer
example.com. 86400 IN SOA ns1.example.com. root.example.com. (
                                2015013001 ; serial
                                86400      ; refresh (1 day)
                                7200       ; retry (2 hours)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
example.com. 86400 IN NS ns2.example.com.
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN A 10.2.2.22

How would I do the same for the reverse zones (set up in, for example, the 10.5.0.zone file)?

Best Answer

The same way you do with a forward zone, by requesting the SOA record of the zone. For IP-address A.B.C.D the zone name is often C.B.A.IN-ADDR.ARPA but you can simply request the SOA for the host D.C.B.A.IN-ADDR.ARPA:

 dig SOA D.C.B.A.IN-ADDR.ARPA 

And for your 10.5.0.x range:

 dig SOA 0.5.10.in-addr.arpa 

For the Google public DNS resolver 8.8.8.8 you'll see this:

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.1 <<>> @4.2.2.1 8.8.8.8.in-addr.arpa SOA

;; QUESTION SECTION:
;8.8.8.8.in-addr.arpa.      IN  SOA

;; AUTHORITY SECTION:                                             ;;  serial  refresh retry  expire  minimum
8.8.8.in-addr.arpa. 41  IN  SOA ns1.google.com. dns-admin.google.com. 1580969 21600   3600   1209600 10800
Related Topic