-
Notifications
You must be signed in to change notification settings - Fork 19
Extra fields for MX, SVR, etc? #160
Comments
Currently no, but it's certainly something worth thinking about. There are quite a lot of possible record types with different syntax requirements, which will make it a major effort to implement sensible forms for all of them. However, there is good old issue #72, which may address some of the things you have in mind at least on the verification level. One of the ideas would be to define regular expressions for all or at least the most common record types that provide a simple way to safeguard against incorrect entries. They could also be made configurable so specific requirements can be adjusted to. By the way, every record does have a name, which is implicitly referring to the zone name in many cases (often for TXT, SOA, NS, MX etc.). The name is one of the things that are never optional. Have a look at RFC 1035 Section 3.2. However, thinking about it we could make entering it optional and substitute the domain name or "@" (short for the current origin, by default the zone name) for an empty name. |
Thanks for the reply. Yes, I was thinking "optional" as @ for short since that is a common shorthand. I may toy around with some basic forms and do a PR if I get something workable. Possibly changing the form up depending on the record type that's selected. I think I saw that as something that was working in Netbox 3.2 on some of the default forms. |
I think that would be exactly the right way to do it - select a record type at the top of the form and then dynamically enable and disable the required form fields depending on what type was selected. The main thing about that will be to get the fields for all of the possible record types right, but once the functionality is in place in principle that should be something that can be gradually extended. |
I don't know if I'd recommend using regular expressions to validate the data. I'd use dnspython. It has a really handy function dns.rdata.from_text() for parsing the data:
dnspython is pure Python, widely packaged, and has comprehensive coverage of DNS record types. |
Looks like a much more elegant solution to me, thanks! |
@amyers1616: Did you find the time to play around with the idea of dynamic forms that change the data to be entered depending on the record type that was selected? I'm not much of a JavaScript guy, so I shy away from digging into this issue, but if you have some viable approach for at least the most common record types I'd be willing to take it from there, or we could work out the feature together. I still think it's a great idea and would make life for the casual user much easier. |
@peteeckel - no, I didn't mess with it at all. I'm even worse at javascript than I am at python and it's just not been a priority yet. |
Too bad ... OK, I'll see if I can hack something sensible together. It seems Bootstrap has some mechanisms ( Don't hold your breath, though ... |
Are there plans for adding the ability to store more information with certain records like, MX and SVR? These types need additional information in their records to be useful. Things like TXT records on the other hand, don't necessarily need a name value for the record and should be optional.
The text was updated successfully, but these errors were encountered: