Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter DNSsync entries for each view #401

Closed
alehaa opened this issue Sep 17, 2024 · 4 comments · Fixed by #407
Closed

Filter DNSsync entries for each view #401

alehaa opened this issue Sep 17, 2024 · 4 comments · Fixed by #407
Assignees
Labels
enhancement New feature or request

Comments

@alehaa
Copy link

alehaa commented Sep 17, 2024

Is your feature request related to a problem? Please describe.
Right now, IPAM DNSsync automatically creates a DNS record for all "zones with matching names in the DNS views linked to the IP address' prefix". However, sometimes not all DNS names should be published into each zone, i.e. when a service is just internal but uses the same domain as public services. It would be nice to optionally filter which records will be populated in a zone.

Describe the solution you'd like
An optional filter could be added to each view. The IP-Address object would be passed to the filter. If the filter doesn't match, creating the record is skipped. NetBox already includes similar functionality e.g. for permissions or custom links.

Users then could either leave this field empty (all records will be published to all matching zones of the view). Otherwise the filter could check on IPAddress fields, custom fields or even related values like the device / vm it's attached to.

Describe alternatives you've considered

  • Filtering a common zone on export doesn't allow adding records explicitly for the external zones. This might be required e.g. for adding validation TXT records.
  • Adding manual records is an option, but not as cool as doing it automatically. ;)

Additional context
None

@peteeckel peteeckel self-assigned this Sep 17, 2024
@peteeckel peteeckel added the enhancement New feature or request label Sep 17, 2024
@peteeckel
Copy link
Owner

Hi @alehaa, thanks for this feature suggestion - I'll think about how to best implement it. The use cases are clear and it certainly makes sense to define a mechanism that makes it possible to filter IP addresses per view that should will result in address records.

Originally I had the idea to provide some means of defining a list of views to exclude per IP address, but found it clumsy and postponed it. But your idea definitely has more charm and could be easier to implement as well.

@peteeckel
Copy link
Owner

Hi @alehaa, if you like you can give the linked PR a test run. I think it's doing its job, but I would be pleased if you have a look at it and provide an opinion.

@alehaa
Copy link
Author

alehaa commented Sep 21, 2024

@peteeckel Thanks a lot! I tested it with some of my zones and records and it seems to work fine. Also, filtering by related attributes seems to work, i.e. using the field of an assigned tenant.

@peteeckel
Copy link
Owner

@alehaa Thanks for the quick response!

I just merged the branch, but if you find any obstacles I'll still be glad to fix them before the next release. Currently I try to stay in sync with the NetBox releases (saves some testing), and so I would expect the feature to get published in about three weeks' time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants