Skip to content

Support for netbox-dns plugin #41

Description

@apoxa

I'm using the netbox-dns-plugin, which extends NetBox with complete DNS zone management functionality. This adds additional features like zones and other record types. It'd be great if I could query this information from coredns with your plugin.

I had a look at the plugin code and have some ideas how to implement this. I'd add a boolean argument in setup.go, which toggles if the native API or the DNS plugin API is used.

case "zoneplugin":
	if !c.NextArg() {
		return nil, c.ArgErr()
	}
	zoneplugin, err := strconv.ParseBool(c.Val())
	if err != nil {
		return n, c.Errf("could not parse 'zoneplugin': %s", err)
	}
	n.ZonePlugin = zoneplugin

Then I'd convert func query() to a wrapper function which calls either the existing query() (renamed to e.g. queryNative()) function or a new function queryZonePlugin().

func (n *Netbox) query(host string, family int) ([]net.IP, error) {
	if n.ZonePlugin {
		return n.queryZonePlugin(host, family)
	}
	return n.queryNative(host, family)
}

I'd be happy to try and implement that functionality into your plugin, if you find this useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions