The NetBox DNS plugin enables NetBox to manage operational DNS data such as name servers, zones, records and views, as well as registration data for domains. It can automate tasks like creating PTR records, generating zone serial numbers, NS and SOA records, as well as validate names and values values for resource records to ensure zone data is consistent, up-to-date and compliant with to the relevant RFCs.
NetBox DNS is designed to be the 'DNS Source of Truth' analogous to NetBox being the 'Network Source of Truth'.
The plugin stores information about DNS name servers, DNS views and zones, and DNS records, making it a data source for automatic provisioning of DNS instances. Registration information about DNS registrars and contacts for DNS domains can also be stored and associated with zones.
The main focus of the plugin is to ensure the quality of the data stored in it. To achieve this, there are many validation and automation mechanisms in place:
- Validation of record names and values
- Automatic maintenance of PTR records for IPv6 and IPv4 address records
- Automatic generation of SOA records, optionally including the serial number of the zone data
- Validation of changes to the SOA SERIAL number, whether they are done automatically or manually
- Validation of record types such as CNAME and singletons, to ensure DNS zone validity
- Support for RFC 2317 delegation of PTR zones for IPv4 subnets longer than 24 bits
- Templating for zones and records enables faster creations of zones with given boilerplate object relations, such as name servers, tags, tenants or registration information, or records like standard SPF or MX records that are the same for a subset of zones
Other main features include:
- Support for BIND views, providing lightweight namespaces for zones
- Support for IDN, including the validation of punycode names
- Full support for the NetBox REST and GraphQL APIs
- Support for all major NetBox features such as global search, tenancy, change logs, tagging, journaling etc.
In the same way as NetBox is not a network management application, NetBox DNS does not provide any functionality to manage specific name servers or DNS service providers or to generate input such as configuration and zone files for them. The focus is on the completeness and integrity of the data needed to run DNS zones, not on the peculiarities of a plethora of servers and services that actually use the data. This functionality is left to specialized integration tools, or in many cases it can be easily implemented using Ansible or similar tools based on NetBox DNS data. Example code for some simple use cases is provided.
For integration with a large number of DNS server implementations integration tools like octodns-netbox-dns are available.
- NetBox 4.0.0 or higher
- Python 3.10 or higher
$ source /opt/netbox/venv/bin/activate
(venv) $ pip install netbox-plugin-dns
Add the plugin to the NetBox config. ~/netbox/configuration.py
PLUGINS = [
"netbox_dns",
]
To permanently keep the plugin installed when updating NetBox via update.sh
:
echo netbox-plugin-dns >> ~/netbox/local_requirements.txt
To add the required netbox_dns tables to your database run the following command from your NetBox directory:
./manage.py migrate
Full documentation on using plugins with NetBox: Using Plugins - NetBox Documentation
Contributions are always welcome! Please see the Contribution Guidelines
For further information, please refer to the full documentation: Using NetBox DNS
MIT