auroraresearchlab / netbox-dns

Netbox Dns is a netbox plugin for managing zone, nameserver and record inventory.
MIT License
208 stars 19 forks source link

Link DNS RRs to IPAM data #32

Closed peteeckel closed 1 year ago

peteeckel commented 2 years ago

This is probably more a long-term project than something that can be implemented in a singe PR.

In the IPAM module there are lots of IP address data, together with an optional DNS name. This is exactly the information that is maintained in the DNS module as well with a different focus. It would be very useful to provide some kind of link between the two in some way that probably needs to be discussed further.

Some ideas:

I did not dig into the Netbox code base too deeply yet, so I'm not sure whether a plugin can change the behaviour of a core module (which would be necessary for some of the functionality sketched above), or if a cross-referece to data from a core module is possible at all from a plugin, but it would be really nice to have.

Another issue is that IP addresses are not necessarily in a 1-1 relation to DNS records if different VRFs or different DNS views (BIND jargon) are in use, so that one IPAM IP address might be present in different zones/views. This is something that probably needs some discussion.

pixelrebel commented 2 years ago

This netbox webhook project uses the IPAM database to push updates to the DNS servers. Syncing this DNS plugin to IPAM with the dnsupdate webhook would be the holy grail for one-step DNS/IPAM management.

peteeckel commented 2 years ago

This netbox webhook project uses the IPAM database to push updates to the DNS servers. Syncing this DNS plugin to IPAM with the dnsupdate webhook would be the holy grail for one-step DNS/IPAM management.

This is another interesting approach, but less to this issue than to the one addressed in #8.

I'll have to have a look when I find the time, but currently I see some issues that need to be resolved (see also discussion #182):

... and probably some more "interesting" issues.

Perhaps it will be the shorter route to look at octodns and the provider created by @jcollie, but the webhook architecture can also be a good start for other specific solutions.

peteeckel commented 1 year ago

After a long hiatus, here's a quick update.

As of today (NetBox 3.3.x) there are not too many documented and supported ways to interact with core NetBox models from a plugin.

This will change to some extent in NetBox 3.4. With the upcoming version among other enhancements there will be an option to create plugin specific panels in core views, which I'm currently playing around with. Functionality is currently limited to an informational aspect such as showing the related DNS records for an IP address, but I can imagine going on from there to more involved scenarios, as far as the plugin interface allows.

My current idea is to implement the integration feature as an optional feature in NetBox DNS, which needs to be enabled in the plugin configuration to work so it doesn't interfere with the NetBox core interface in case anything does not work as planned.