Reloading Zones¶
Reload zones after making changes to zone files.
When to Reload¶
Reload a zone when: - Zone file has been modified - Records have been added/removed/changed - SOA serial has been incremented - After manual edits to zone files
Reload Zone¶
POST /api/v1/zones/{name}/reload
Request¶
curl -X POST http://localhost:8080/api/v1/zones/example.com/reload \
-H "Authorization: Bearer $TOKEN"
Response¶
{
"success": true,
"message": "Zone example.com reloaded successfully",
"details": "zone example.com/IN: loaded serial 2024010102"
}
Status Codes¶
200 OK- Zone reloaded successfully401 Unauthorized- Missing/invalid token404 Not Found- Zone doesn't exist500 Internal Server Error- RNDC reload command failed
Workflow¶
1. Modify Zone File¶
Edit the zone file on the shared volume:
# Example: Add a new A record
echo "newhost IN A 192.0.2.10" >> /var/cache/bind/example.com.zone
# Increment SOA serial
# Edit SOA record to increment serial number
2. Reload via API¶
curl -X POST http://localhost:8080/api/v1/zones/example.com/reload \
-H "Authorization: Bearer $TOKEN"
3. Verify¶
# Check zone status
curl http://localhost:8080/api/v1/zones/example.com/status \
-H "Authorization: Bearer $TOKEN"
# Or query DNS directly
dig @localhost example.com newhost.example.com
Best Practices¶
- Always increment SOA serial - Before reloading
- Validate zone file syntax - Use
named-checkzoneif available - Test in development first - Before production changes
- Monitor logs - Check for reload errors
- Verify changes - Query DNS after reload
Troubleshooting¶
Reload Fails¶
Solution: Verify zone name is correct and zone exists.
Zone File Syntax Error¶
{
"error": "RndcError",
"message": "zone example.com/IN: loading from master file failed: syntax error"
}
Solution: Check zone file syntax with named-checkzone.
Permission Denied¶
Solution: Verify file permissions on zone file.
Next Steps¶
- Zone Status - Check zone status
- Deleting Zones - Remove zones