-
Maybe I am overlooking something here but I have two views setup one for public and one for internal. Need to have a different hostname/PTR for the public vs internal. When I go to edit the IP address I can only choose one zone and one record per IP address. Am I missing something or is this not supported? I would assume this is what several people are using views for but I could be wrong. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
Hi @bradbendy, you are completely correct in your assessment. This is exactly the reason why the IPAM coupling feature as it is now is labelled "experimental" - it has some limitations that are not recommending it for production-level use. One of the limitations is the restriction you found - the solution is limited to one view per IP address, and the current concept does not allow to extend it beyond that. There are, however, plans and a new concept for IPAM synchronisation that does not have this limitation. If all goes according to to plan this will be addressed in the next few months. It will also make coupling IP addresses to DNS records more automated than it is now. |
Beta Was this translation helpful? Give feedback.
-
Just so you can plan forward, here's the new concept in short words:
This, unfortunately, has some limitations, too, though much less problematic ones:
If a plugin could modify core forms there would be some more options for an automatism, but after thinking about it for quite some time this is the most flexible solution I can come up with at the moment. |
Beta Was this translation helpful? Give feedback.
-
So I guess for what im trying to do that won't work anyways. We have a use case that the views have different DNS names, so same IP but the view then determines what actual record is shown (think hostnames on routers and you want more generic public facing but more descriptive for internal folks). Issue with a custom field is then that field is at the bottom so from a process flow when adding a new IP it's not very clean (why I held off trying to roll something custom myself). But yes I can see how since we can't modify the native forms it does pose a challenge on how to do certain things. If there is going to be a config variable for only having it use the "DNS Name" field on the IP address I guess I could do a custom field then have a script run and insert the internal view record via the API. That might be easiest for me, just do a webhook on update of IP address and be done with it. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's one of the cases where any automatism faces some challenges - if you need to maintain multiple different host names per IP address (and not the same FQDN in multiple views) you'd need a couple of custom fields in the IPAddress field, and since custom fields are pretty limited, too, you'd have to create some code specific to your use case anyway. This doesn't lend itself to any kind of generic automatism at all. How do you determine the host names (and which host name to apply in which view) for each IP address? Somewhere there must be some kind of mapping, either individually for each IP address or on a higher hierarchy level (VRF, prefix, IP range etc). I'm always looking for the most generic solution possible as it doesn't help if a solution works for one specific use case only - if you have a good idea for a more generic solution that the one I came up with above I'll be glad to adopt it. But as you said - custom fields are nice, but limited (and placed awkwardly for any work flow), additionally you can't get rid of the "DNS Name" field, which is then bound to confuse at least some users (which is why I plan to actually use it as the source of the FQDN), and we can't change the core forms so we need to work with what we have plus custom fields. I agree with you that if your case is so special that a generic solution (which is bound to be a compromise in most cases) doesn't fit at all a custom script that triggers on IP address creations, updates and deletions will be your best bet. Fortunately NetBox provides that option, but if I can bake in something generic that helps I'll be glad to do so. |
Beta Was this translation helpful? Give feedback.
-
After thinking about this a bit longer, so far the only idea i could come up with that would solve your problem in a general way is a JSON custom field that contains a mapping between views and FQDNs per IP address, such as { With the value of "DNS Name" being used as a default if the JSON field is missing or there is no mapping for a specific view. IMHO this is awkward and does not really provide a desirable UX. The advantages of this method in the workflow are also somewhat limited, so unless someone finds it immensely useful I'd rather not go down that road. Another way would be to use the generic mechanism and add |
Beta Was this translation helpful? Give feedback.
-
This question it's quite old so let me know if my question is not related and I'll open a new one. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I just tried you propose solution and is excellent!, as you said the most elegant would be to have multiple DNS entries in DNS Name, but feature_ipam_dns_info it's really useful. I think it should have a dedicated section in the documentation. Thank you so much for you help. |
Beta Was this translation helpful? Give feedback.
Hi @bradbendy, you are completely correct in your assessment.
This is exactly the reason why the IPAM coupling feature as it is now is labelled "experimental" - it has some limitations that are not recommending it for production-level use. One of the limitations is the restriction you found - the solution is limited to one view per IP address, and the current concept does not allow to extend it beyond that.
There are, however, plans and a new concept for IPAM synchronisation that does not have this limitation. If all goes according to to plan this will be addressed in the next few months. It will also make coupling IP addresses to DNS records more automated than it is now.