Oddity with nsd-based in-addr.arpa zone

Dave Ulrick d-ulrick at comcast.net
Tue Aug 1 19:06:13 UTC 2017

I'm using Unbound & nsd to provide DNS services on my home LAN. nsd 
listens on udp/5053 and acts as authoritative DNS server for a forward 
zone (home.du) and a reverse zone (168.192.in-addr.arpa). The forward zone 
works well as an Unbound 'stub-zone' but I've run into some strangeness 
with the reverse zone.

Most of my IPs are in 192.168.1.x but I have a few IPs in other 
192.168.x.x subnets: 192.168.56.x and 192.168.100.x in particular.

Assuming that I have this statement in unbound.conf:

local-zone: "168.192.in-addr.arpa." nodefault

I get good resolver performance if I create separate nsd zones for:


which are defined like this in nsd.conf:

       name: "1.168.192.in-addr.arpa"
       zonefile: "1.168.192.in-addr.arpa.zone"

and define them to Unbound like so:

 	name: "1.168.192.in-addr.arpa"
 	stub-addr: at 5053

 	name: "56.168.192.in-addr.arpa"
 	stub-addr: at 5053

 	name: "100.168.192.in-addr.arpa"
 	stub-addr: at 5053

but given that my DNS setup is so small I'd really rather just have one 
reverse zone:


defined in nsd like:

       name: "168.192.in-addr.arpa"
       zonefile: "168.192.in-addr.arpa.zone"

This consolidated zone is structured thusly:

@		SOA	...
 		NS	...
 		NS	...

$ORIGIN 1.168.192.in-addr.arpa.
1	PTR	...

$ORIGIN 56.168.192.in-addr.arpa.
1	PTR	...

$ORIGIN 100.168.192.in-addr.arpa.
1	PTR	...

Given this consolidated zone, nsd promptly answers queries that are 
directly sent to it such as with 'nslookup -port=5053 -'. However, 
if I configure the zone in unbound.conf like this:

 	name: "168.192.in-addr.arpa"
 	stub-addr: at 5053

the queries are _not_ resolved. However, if I define the zone as a 
forward-zone it works perfectly (all queries are replied to either 
positively or negatively in a prompt manner):

 	name: "168.192.in-addr.arpa"
 	forward-addr: at 5053

Note that adding the trailing '.' to the zone name in the Unbound or nsd 
configuration files appears to have no functional or performance effect. 
(Of course, the zone files themselves _do_ use trailing '.' at the end of 
each name.)

My understanding is that a 'stub-zone' is to be used for authoritative 
zones whereas a 'forward-zone' is to be used if recursive lookups might 
occur. Given that nsd is purely an authoritative DNS server, it doesn't 
make sense that I'd get bad results with 'stub-zone' but good results with 
a 'forward-zone'. In fact, using a 'forward-zone' for an nsd-hosted zone 
doesn't make any sense at all!

An Internet search reveals that many others have had issues with 
configuring reverse zones but nobody seems to have ended up with my exact 
configuration. Therefore, I thought I ought to run this by the Unbound 
experts to see if you can shed any light on this.

Dave Ulrick
d-ulrick at comcast.net

More information about the Unbound-users mailing list