Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This plugin gets an A record from NetBox1. It uses the REST API of netbox to ask for a an IP address of a hostname:


    "count": 1,
    "next": null,
    "previous": null,
    "results": [
            "family": {
                "value": 4,
                "label": "IPv4"
            "address": "",
            "interface": {
                "id": 452,
                "url": "",
                "virtual_machine": {
                    "url": "",


To activate the netbox plugin you need to compile CoreDNS with the plugin added to plugin.cfg

Ordering in plugin.cfg

The ordering of plugins in the plugin.cfg file is important to ensure you get the behaviour you expect when using multiple plugins in a Corefile server block.

For example, in order to utilise the native cache plugin, ensure that you add the netbox plugin after cache:cache but before any plugins you want to be able to fall-through to (eg file:file or forward:forward).


netbox [ZONES...] {
  token TOKEN
  url URL
  fallthrough [ZONES...]
  • ZONES zones that the netbox should be authoritative for.

  • token TOKEN sets the API token used to authenticate against NetBox (REQUIRED).

  • url URL defines the URL netbox should query. This URL must be specified in full as SCHEME://HOST/api/ipam/ip-addresses (REQUIRED).

  • tls is followed by:

    • no arguments, if the server certificate is signed by a system-installed CA and no client cert is needed (this is the default if HTTPS is used).
    • a single argument that is the CA PEM file, if the server cert is not signed by a system CA and no client cert is needed.
    • two arguments - path to cert PEM file, the path to private key PEM file - if the server certificate is signed by a system-installed CA and a client certificate is needed.
    • three arguments - path to cert PEM file, path to client private key PEM file, path to CA PEM file - if the server certificate is not signed by a system-installed CA and client certificate is needed.

    These options set certificate verification method for the NetBox server if HTTPS is used to access the API.

  • ttl DURATION defines the TTL of records returned from netbox. Default is 1h (3600s).

  • timeout DURATION defines the HTTP timeout for API requests against NetBox. Default is 5s.

  • fallthrough If a zone matches but no record can be generated, pass request to the next plugin. If [ZONES…] is omitted, then fallthrough happens for all zones for which the plugin is authoritative. If specific zones are listed then only queries for those zones will be subject to fallthrough.

The config parameters token, url and localCacheDuration are required.


Send all requests to NetBox:

. {
    netbox {
        token SuperSecretNetBoxAPIToken

Send requests within to NetBox and fall-through to the file plugin in order to respond to unsupported record types (ie SOA, NS etc):

. {
    netbox {
        token SuperSecretNetBoxAPIToken

Handle all requests with netbox and fall-through to the forward plugin for requests within with caching via the cache plugin:

. {
    netbox {
        token SuperSecretNetBoxAPIToken
    forward .


0.2 - Cleanup add IPv6 support

  • Refactor query.go
  • Add tests for IPv6
  • Enable IPv6 in query.go

0.1 - Initial Naive release

  • Got it somehow working
  • Gather feedback

Developing locally

You can test the plugin functionallity with CoreDNS by adding the following to go.mod in the source code directory of coredns.

replace => <path-to-you-local-copy>/coredns-netbox-plugin

Testing against a remote instance of netbox is possible with SSH port forwarding:

Host YourHost
   ProxyJump YourJumpHost
   LocalForward 18443


This plugin is heavily based on the code of the redis-plugin for CoreDNS.