GithubHelp home page GithubHelp logo

How this plugin works about netbox-dns HOT 7 CLOSED

klenzel avatar klenzel commented on August 16, 2024
How this plugin works

from netbox-dns.

Comments (7)

peteeckel avatar peteeckel commented on August 16, 2024

Hi Daniel,

thanks for the feedback! I'm glad you find the plugin useful.

As for integration with the rest of NetBox ... currently there is no automatism in place that would transfer data from NetBox to DNS zones. The reason is that linking existing data to DNS is by no means trivial and obvious - there are many possible scenarios that need to be addressed. So at the moment (there are some ideas being floated, but nothing tangible yet) there is no integrated mechanism to link IPAM data to NetBox DNS.

There is, however, a powerful scripting mechanism built into NetBox DNS that can be used to manually transfer existing IPAM data to NetBox DNS. Using a custom script it's possible to traverse e.g. existing NetBox 'IP Address' objects, take the 'DNS Name' and 'IP Address' field from them, and add them as A/AAAA records to NetBox DNS. Optionally, you could also create the forward and reverse zones while doing this - YMMV.

What's much more difficult is to create a mechanism to automatically synchronise IPAM and DNS data ... while things like duplicate addresses in different VRFs can be solved using views, there is the question of what should happen when IPAM data get updated or deleted, or when a device or virtual machine is removed (NetBox itself keeps the IPAM data, so probably the DNS records should be retained as well - but what should happen when an IP Address object or a Prefix object is deleted?

tl;dr
Tighter integration with IPAM is a planned feature, but not there yet (and will definitely take some time to be released), but custom scripts can be used to synchronise IPAM and DNS data and vice versa. When I find the time I can add some example scripts to the distribution so you have a base for your own solution - would that help you?

from netbox-dns.

klenzel avatar klenzel commented on August 16, 2024

Hello and thank you for your answer. It's a pity that synchronization isn't possible at the moment. Since I've only been dealing with Netbox for a short time, I'm not familiar with the scripts yet. Therefore, a few examples (like in the general readme for everyone) would be very helpful.

from netbox-dns.

peteeckel avatar peteeckel commented on August 16, 2024

I'll provide something as soon as I find the time. Stay tuned :-)

There's also more documentation in docs and some example code (also an example script for exporting NetBox DNS data to BIND) in examples, maybe there's some interesting stuff for you too.

from netbox-dns.

peteeckel avatar peteeckel commented on August 16, 2024

Hi Daniel, I have something for you to play with.

DNS Name Record Updater

Creates or update DNS address records in zones with a specified View (default is None) for all IPAM 'IP Address' objects with a specified VRF (default is None).

Records will only be created for existing zones, new zones are never created. If there is no direct parent zone in NetBox DNS, no multi-label host names will be created either. If there are multiple address records within the specified view pointing to an address, no record will be created or updated. However the script will happily create duplicate names with different addresses to facilitate round robin DNS schemes.

There is a switch that allows overwriting existing records, the default setting is not to overwrite any conflicting values.

IPAM Hostname Updater

Creates or updates the 'DNS Name' field for all IPAM 'IP Address' objects with a specified VRF (default is None) from DNS address records in NetBox DNS.

If there are multiple address records pointing to an address the 'DNS Name' field will not be updated.

There is a switch that allows overwriting existing DNS names, the default setting is not to overwrite any conflicting values.

Installation

To install, follow the usual steps:

  1. Configure SCRIPTS_ROOT in configuration.py
  2. Copy the module examples/custom-scripts/DNS_IPAM_Updater.py containing the scripts to the directory specified in SCRIPTS_ROOT

Warning

These scripts are provided as they are. They have not been thoroughly tested and may corrupt your NetBox database, including IP Address and NetBox DNS objects. Use at your own risk as a basis for your own experiments. You better have a backup.

As always, feedback is welcome!

Have a nice evening,

Pete.

from netbox-dns.

klenzel avatar klenzel commented on August 16, 2024

Thank you very much for your work. I will work through your examples. I hope your work can help others too.
Should i close this issue or will you transform it into a feature-request?

from netbox-dns.

peteeckel avatar peteeckel commented on August 16, 2024

Should i close this issue or will you transform it into a feature-request?

As currently I'm in discussions about how an integration with IPAM could and should look like (the longer you think about it the less obvious the whole issue turns out to be), it'd difficult to formulate a sensible feature request ... so if you don't mind it would be OK to close it. On the other hand, as soon as PR #285 is merged it will be closed anyway.

from netbox-dns.

peteeckel avatar peteeckel commented on August 16, 2024

I should have tested a bit more as it turned out ... updating the IPAM 'DNS Name' stuff was not really working well. This is fixed now.

from netbox-dns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.