Package: octodns-netbox
ANetBoxsource foroctoDNSThis project provides a NetBox source for OctoDNS. It retrieves IP address information from NetBox so that OctoDNS creates corresponding A/AAAA and PTR records.Note:This is just asourcefor OctoDNS, not aprovider. It only serve to populate records into a zone, cannot be synced to.Installationpip install octodns-netboxGetting startedYou must configure theurlandtokenparameters in your YAML file to work with the NetBox API. You can also specify the TTL (Time to Live) for the generated records, but this parameter is optional, and the default value is 60.providers:netbox:class:octodns_netbox.NetboxSourceurl:https://ipam.example.comtoken:env/NETBOX_TOKENttl:60A records / AAAA recordsTo create A/AAAA records for octoDNS, you need to manage the mapping between IP addresses and fully qualified domain names (FQDNs) in NetBox. Thedescriptionfield is used for this purpose, and it should contain a comma-separated list of hostnames (FQDNs).Starting withNetbox v2.6.0, Netbox now has adns_namefield in IP address records. But wedo notuse this field by default because thisdns_namefield can only storesingleFQDN. To use adns_namefield, setfield_name: dns_nameinthe configuration.PTR recordsoctodns-netboxalso supports PTR records. By default, only the first FQDN in the field is used to generate the PTR record, but you can enable multiple PTR records for a single IP by setting themultivalue_ptrparameter totrueinthe configuration.🔍 Example (multivalue_ptr: false- default)IP Address:192.0.2.1/24Description:en0.host1.example.com,host1.example.comDNS Zone:2.0.192.in-addr.arpa.1. PTR en0.host1.example.com.🔍 Example (multivalue_ptr: true)IP Address:192.0.2.1/24Description:en0.host1.example.com,host1.example.comDNS Zone:2.0.192.in-addr.arpa.1. PTR en0.host1.example.com.1. PTR host1.example.com.Classless subnet delegation (IPv4 /31 to /25)If you are using classless subnets in Netbox, you can automatically expand records for the following format zones:<subnet>-<subnet mask bit count>.2.0.192.in-addr.arpa(RFC 4183style)<subnet>/<subnet mask bit count>.2.0.192.in-addr.arpa(RFC 2317style)ExamplesHere is an example configuration for octodns-netbox:providers:netbox:class:octodns_netbox.NetboxSource# Your Netbox URLurl:https://ipam.example.com# Your Netbox Access Token (read-only)# This token should have read-only access to Netbox.token:env/NETBOX_TOKEN# The TTL of the generated records (Optional, default: 60)# Time to Live (TTL) specifies the time interval that a DNS record is stored in cache.# The default value of 60 is commonly used for dynamic DNS records.ttl:60# Advanced Parameters:# The following parameters are optional and can be ignored for most use cases.# Generate records including subdomains (Optional, default: `true`)# If `false`, only records that belong directly to the zone (domain) will be generated.# This can be useful to reduce the number of DNS queries and avoid `SubzoneRecordException` errors.populate_subdomains:true# FQDN field name (Optional, default: `description`)# The `dns_name` field on Netbox is provided to hold only a single name,# but typically one IP address will correspond to multiple DNS records (FQDNs).# The `description` does not have any limitations so by default# we use the `description` field to store multiple FQDNs, separated by commas.# Other tested values are `dns_name`.field_name:description# Tag Name (Optional)# By default, all records are retrieved from Netbox, but it can be restricted# to only IP addresses assigned a specific tag.# Multiple values can be passed, resulting in a logical AND operation.populate_tags:-tag_name# VRF ID (Optional)# By default, all records are retrieved from Netbox, but it can be restricted# to only IP addresses assigned a specific VRF ID.# If `0`, it explicitly points to the global VRF.populate_vrf_id:1# VRF Name (Optional)# VRF can also be specified by name.# If there are multiple VRFs with the same name, it would be better to use `populate_vrf_id`.# If `Global`, it explicitly points to the global VRF.populate_vrf_name:mgmt# Multi-value PTR records support (Optional, default: `false`)# If `true`, multiple-valued PTR records will be generated.# If `false`, the first FQDN value in the field will be used.multivalue_ptr:trueroute53:class:octodns_route53.Route53Provideraccess_key_id:env/AWS_ACCESS_KEY_IDsecret_access_key:env/AWS_SECRET_ACCESS_KEYzones:example.com.:sources:-netbox# will add A/AAAA recordstargets:-route530/26.2.0.192.in-addr.arpa.:sources:-netbox# will add PTR records (corresponding to A records)targets:-route530.8.b.d.0.1.0.0.2.ip6.arpa:sources:-netbox# will add PTR records (corresponding to AAAA records)targets:-route53ContributingSeethe contributing guidefor detailed instructions on how to get started with our project.LicenseMIT