0

I want to include a file in the zone file in a nsd name server implementation, using the $INCLUDE directive.

When I reload the zone with the nsd-control reload <zone> command, in the log file I notice an error about not finding the include file.

Does anyone know how to include the file in the zone file definition? NSD seems to lack a thorough documentation (like BIND).

HBruijn
  • 72,524
  • 21
  • 127
  • 192
epistola
  • 3
  • 2
  • 1
    Does `nsd-checkzone` the NSD zone file syntax checker give any meaningful output? – HBruijn Feb 17 '15 at 08:01
  • When i include the file with quotes ("") the nsd-checkzone does not complain. When i remove the quotes, the checker is ok. But the log file, in both cases, complain about not being able to find the file. – epistola Feb 17 '15 at 08:13
  • Are you using and absolute path `$INCLUDE "/var/named/inc/default-records.inc" ` or a relative path? – HBruijn Feb 17 '15 at 08:39
  • Actually, i use this directive: $INCLUDE /usr/local/etc/nsd/zones/forward/COMMON. I want to have in a common file things like SOA and NS, MX records, which are the same for all the zones/subzones – epistola Feb 17 '15 at 09:05

1 Answers1

1

Based on your comment:

Actually, I use this directive: $INCLUDE /usr/local/etc/nsd/zones/forward/COMMON. I want to have in a common file things like SOA and NS, MX records, which are the same for all the zones/subzones

Where my first response is that setting the SOA record in a master include file is a bad idea as that means that all your DNS zones will have the same version number and an update to one will require reloading all zones.

The use of the $INCLUDE directive is established in RFC 1035 and one of the design goals nsd is to be completely RFC compliant.

Unless you're running into a simple error in the file-system permissions it seems likely you're running into the requirements that are set in RFC 1035 section 5.2 for include (master) files and zone files:

  1. All RRs in the file should have the same class.

So having both NS and MX records in the same include file seems forbidden.

  1. Exactly one SOA RR should be present at the top of the zone.

Setting the SOA record in an $INCLUDE file appears to be forbidden as well.

  1. If delegations are present and glue information is required, it should be present.

Apparently glue records are allowed so NS and specific A records can be combined in a single include file...

  1. Information present outside of the authoritative nodes in the zone should be glue information, rather than the result of an origin or similar error.
HBruijn
  • 72,524
  • 21
  • 127
  • 192