DNS HOWTO : A simple domain. : The reverse zone
Previous: Our own domain
Next: Words of caution

5.3. The reverse zone

Now programs can convert the names in freebsd.bogus to addresses which they can connect to. But also required is a reverse zone, one making DNS able to convert from an address to a name. This name is used by a lot of servers of different kinds (FTP, IRC, WWW and others) to decide if they want to talk to you or not, and if so, maybe even how much priority you should be given. For full access to all services on the Internet a reverse zone is required.

Put this in named.conf:


zone "196.168.192.in-addr.arpa" {
        type master;
	notify no;
        file "pz/192.168.196";
};

This is exactly as with the 0.0.127.in-addr.arpa, and the contents are similar:


$TTL 3D
@	IN	SOA	ns.freebsd.bogus. hostmaster.freebsd.bogus. (
			199802151 ; Serial, todays date + todays serial
			8H	; Refresh
			2H      ; Retry
			4W	; Expire
			1D)	; Minimum TTL
		NS      ns.freebsd.bogus.

1		PTR	gw.freebsd.bogus.
2		PTR	ns.freebsd.bogus.
3		PTR	donald.freebsd.bogus.
4		PTR	mail.freebsd.bogus.
5		PTR	ftp.freebsd.bogus.

Now you reload your named (rndc reload) and examine your work with dig again:


$ dig -x 192.168.196.4
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58451
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;4.196.168.192.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
4.196.168.192.in-addr.arpa. 259200 IN   PTR     mail.freebsd.bogus.

;; AUTHORITY SECTION:
196.168.192.in-addr.arpa. 259200 IN     NS      ns.freebsd.bogus.

;; ADDITIONAL SECTION:
ns.freebsd.bogus.         259200  IN      A       192.168.196.2

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Dec 23 03:16:05 2001
;; MSG SIZE  rcvd: 107

so, it looks OK, dump the whole thing to examine that too:


$ dig 196.168.192.in-addr.arpa. AXFR

; <<>> DiG 9.1.3 <<>> 196.168.192.in-addr.arpa. AXFR
;; global options:  printcmd
196.168.192.in-addr.arpa. 259200 IN     SOA     ns.freebsd.bogus. \
	hostmaster.freebsd.bogus. 199802151 28800 7200 2419200 86400
196.168.192.in-addr.arpa. 259200 IN     NS      ns.freebsd.bogus.
1.196.168.192.in-addr.arpa. 259200 IN   PTR     gw.freebsd.bogus.
2.196.168.192.in-addr.arpa. 259200 IN   PTR     ns.freebsd.bogus.
3.196.168.192.in-addr.arpa. 259200 IN   PTR     donald.freebsd.bogus.
4.196.168.192.in-addr.arpa. 259200 IN   PTR     mail.freebsd.bogus.
5.196.168.192.in-addr.arpa. 259200 IN   PTR     ftp.freebsd.bogus.
196.168.192.in-addr.arpa. 259200 IN     SOA     ns.freebsd.bogus. \
	hostmaster.freebsd.bogus. 199802151 28800 7200 2419200 86400
;; Query time: 6 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Dec 23 03:16:58 2001
;; XFR size: 9 records

Looks good! If your output didn't look like that look for error-messages in your syslog, I explained how to do that in the first section under the heading Starting named


DNS HOWTO : A simple domain. : The reverse zone
Previous: Our own domain
Next: Words of caution