Zone Transfer Types
AXFR (Full Transfer)
A complete zone transfer that transmits the entire zone:- Used for initial zone loading
- Used when IXFR is not available
- Transfers all records in the zone
- More bandwidth intensive
IXFR (Incremental Transfer)
Transfers only the changes since the last update:- Requires zone serial number tracking
- More efficient for large zones with small changes
- Falls back to AXFR if changes are too large
- Requires IXFR support on both primary and secondary
Transfer Commands
transfer
Attempt to update secondary zones by contacting primaries:With argument: attempts transfer for specified zone only Examples:
- Contacts the primaries configured via
request-xfrlists - Checks if zone serial has increased
- Performs IXFR if available, otherwise AXFR
- Resets backoff timeout if the zone had no content
force_transfer
Force a full AXFR even if serial numbers match:With argument: forces transfer for specified zone only Examples:
- Performs a full AXFR regardless of serial number
- Useful if zone content is suspect but serial is unchanged
- Interrupts any ongoing transfers
NOTIFY Handling
notify
Send NOTIFY messages to secondary servers:With argument: sends NOTIFY for specified zone only Examples:
- Sends to IP addresses configured in
notify:lists - Only applies to primary zones hosted on this server
- Secondaries should initiate zone transfer upon receiving NOTIFY
- A primary zone serial is updated
- A zone is reloaded with a new serial
- Testing secondary configuration
- Forcing synchronization after network issues
- Notifying after manual zone file updates
Receiving NOTIFYs
Secondary zones are configured to accept NOTIFY from primaries:- NSD checks if the sender is in the
allow-notifyACL - If authorized, NSD attempts a zone transfer
- The transfer uses
request-xfrconfiguration
Zone Status Monitoring
zonestatus
Print detailed state of zones:With argument: shows status for specified zone only
Primary Zone Status
Secondary Zone Status
Zone States
Secondary zones can have the following states:- ok - Zone is up-to-date
- refreshing - Zone has transfer activity in progress
- expired - Zone has expired (could not contact primary within expire time)
Serial Numbers
Three serial numbers are tracked:- served-serial - Currently active, being served to clients
- commit-serial - In reload, will become active soon
- notified-serial - Got NOTIFY, busy fetching the data
Transfer Activity
The status shows current transfer activity:"waiting-for-UDP-fd"- Waiting for UDP socket"sent UDP to <ip>"- Sent SOA query via UDP"waiting-for-TCP-fd"- Waiting for TCP socket"TCP connected to <ip>"- TCP transfer in progress
Notify Activity
For primary zones, the status shows NOTIFY activity:Writing Zone Files
write
Write changed zone files to disk:With argument: writes specified zone if modified Examples:
- Writes zones that changed via AXFR or IXFR
- Creates zone files that don’t exist yet
- Creates directory components if necessary
- Only writes if zone was modified
- Persist transferred zones to disk
- Create zone file backups
- Prepare for server migration
Transfer Configuration
Secondary Zone Pattern
Configure where to request transfers from:Primary Zone Pattern
Configure which secondaries to notify and serve:TSIG Authentication
Secure transfers with TSIG keys:Common Workflows
Initial Secondary Zone Setup
-
Add the secondary zone:
-
Initial transfer starts automatically. Check status:
You’ll see:
-
Wait for transfer to complete:
Eventually:
-
Optionally write to disk:
Handling Missed NOTIFY
If a secondary missed a NOTIFY:-
Check if zone is behind:
Compare serial with primary:
-
Manually trigger transfer:
-
Verify update:
Recovering from Expired Zone
If a zone has expired:-
Check primary is reachable:
-
Force immediate transfer:
-
If still failing, force AXFR:
-
Check logs for errors:
Forcing Zone Refresh
To ensure a zone is fully up-to-date:-
Force full transfer:
-
Monitor the transfer:
-
Write to disk when complete:
Testing NOTIFY
To test NOTIFY configuration:-
On primary, send NOTIFY:
-
On secondary, watch for transfer:
-
Check zone status:
Transfer Tuning
Adjust transfer timing in patterns:IXFR Support
NSD automatically uses IXFR when:- Both primary and secondary support IXFR
- Zone serial has increased
- IXFR is more efficient than AXFR
- IXFR is not available
- IXFR would be larger than AXFR
- IXFR fails
Troubleshooting
Transfer Not Starting
-
Check ACLs in pattern:
-
Verify primary allows transfers:
- Check firewall rules (TCP port 53)
Transfer Timing Out
-
Check
tcp-timeoutsetting innsd.conf: -
Monitor transfer with
zonestatus: -
Try force transfer:
TSIG Verification Failed
-
Verify key names match:
-
Check key is associated with zone:
- Verify key on both primary and secondary match
See Also
- Zone Management - Adding and removing zones
- Control Utility - nsd-control commands
- Pattern Configuration - Transfer settings
- TSIG Configuration - Transfer authentication