Access Control
NSD provides comprehensive access control mechanisms to secure zone transfers, notifies, and queries. Access control is implemented through TSIG keys, ACLs, and TLS authentication.TSIG Keys
TSIG (Transaction Signature) keys provide authenticated communication between DNS servers.Defining TSIG Keys
Define a TSIG key for authentication.
Store keys in a separate file with restricted permissions (mode 600) and include it in the main config.
Unique name for the key. Used to reference the key in ACLs.
HMAC algorithm for the key. Supported algorithms:
hmac-md5(deprecated, weak)hmac-sha1hmac-sha224hmac-sha256(recommended)hmac-sha384hmac-sha512
Base64-encoded secret material. Must match on both sides of the connection.Generate secrets with:
TSIG Key Examples
Access Control Lists (ACLs)
ACLs control which IP addresses can perform specific operations.IP Specifications
ACLs support multiple IP specification formats:| Format | Example | Description |
|---|---|---|
| Single IP | 192.0.2.1 | Single IPv4 address |
| Single IP | 2001:db8::1 | Single IPv6 address |
| CIDR subnet | 192.0.2.0/24 | CIDR notation subnet |
| Netmask | 192.0.2.0&255.255.255.0 | Subnet with explicit mask |
| Range | 192.0.2.10-192.0.2.20 | IP address range |
| With port | 192.0.2.1@5353 | IP with specific port |
| Subnet + port | 192.0.2.0/24@5353 | Subnet with port |
ACL Keywords
No TSIG authentication required for this ACL entry.
Explicitly block access from this address. Supersedes other entries.BLOCKED entries are checked first, then other entries in order.
Zone Transfer Access Control
allow-notify
Control which addresses can send NOTIFY messages for zone updates.Without any
allow-notify entries, notifies from any address are accepted.provide-xfr
Control which addresses can request zone transfers (AXFR/IXFR).Without
provide-xfr entries, no zone transfers are allowed.request-xfr
Specify primary servers from which to request zone transfers.
Query Access Control
allow-query
Control which addresses can query the zone. Without this option, queries are allowed from any IP.
Useful for internal zones or zones meant only for XFR over TLS, preventing content leakage.
TLS Authentication (XFR-over-TLS)
TLS authentication provides mutual authentication for zone transfers over TLS.Defining TLS Auth
Define TLS authentication credentials for XFR-over-TLS.
Name to reference this TLS auth configuration in ACLs.
Authentication domain name as defined in RFC 8310. Must match the SAN DNS entry or CN in the remote certificate.
Client certificate file for mutual TLS authentication.
Client private key file for mutual TLS authentication.
Password for encrypted client key.
XFR-over-TLS Configuration
Server Side (Primary)
Client Side (Secondary)
XFR-over-TLS requires TLS 1.3 support. The server must have a valid certificate, and both sides must have compatible TLS implementations.
Outgoing Interface Control
Specify local IP address for outgoing zone transfer requests or NOTIFY messages.Useful for:
- Satisfying access control lists on remote servers
- Multi-homed servers with multiple IPs
- Source address selection
Complete ACL Examples
Primary Zone with Multiple Secondaries
Secondary Zone with Multiple Primaries
Secure Zone with XFR-over-TLS
Pattern with Comprehensive ACLs
Best Practices
Always use TSIG for zone transfers
Always use TSIG for zone transfers
Protect zone transfers with TSIG authentication:
Store keys in separate files
Store keys in separate files
Keep keys in files with restricted permissions:
Use TLS for sensitive zones
Use TLS for sensitive zones
Deploy XFR-over-TLS for zones with sensitive data:
Use BLOCKED for defense in depth
Use BLOCKED for defense in depth
Explicitly block problematic addresses:
Restrict query access for internal zones
Restrict query access for internal zones
Use allow-query to limit who can query sensitive zones:
Troubleshooting ACLs
How do I debug ACL issues?
How do I debug ACL issues?
Increase verbosity to see ACL decisions:Check logs for:
- “refused notify from” - NOTIFY blocked by allow-notify
- “refused axfr” - Transfer blocked by provide-xfr
- “bad tsig” - TSIG authentication failure
Why are my zone transfers failing?
Why are my zone transfers failing?
Common issues:
- No provide-xfr: Add
provide-xfron primary - TSIG mismatch: Ensure key name and secret match exactly
- Wrong algorithm: Both sides must use same HMAC algorithm
- Blocked by firewall: Check network connectivity
- Port mismatch: Verify @port specifications match
How do ACL entries interact?
How do ACL entries interact?
ACL evaluation order:
- BLOCKED entries are checked first and supersede all others
- Remaining entries evaluated in configuration order
- First match wins
- If no match and ACL type specified, access denied
- If no ACL entries of that type, default behavior applies