MAAS DNS does not permit adding root domain by name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Triaged
|
Medium
|
Unassigned |
Bug Description
Hello,
The MAAS UI, when creating a new domain, will not permit the user to add the domains root record to the zone by name. For example, if one were to create the zone "contoso.com", and then attempt to create an A record for "contoso.com", the form field validation will fail with the error:
---
Error:
Invalid dnsresource name: contoso.com.
---
The code[1] seems to imply that this field should accept three different inputs for the root record:
1. Blank
2. @
3. FQDN
The first option doesn't work because the field is required and can't be empty; the third option doesn't work due to the aforementioned error; the second option is the only one that works in this case. Further down in the linked code section, it appears to be checking for these conditions and just replacing them with @, though since the validation fails earlier on, this part of the code is never used:
---
if fqdn is None or fqdn in SPECIAL_NAMES:
return (fqdn, None)
if domainname is not None:
if domainname == fqdn:
return ("@", fqdn)
---
Expected behavior would be for MAAS to accept those three inputs in the UI for setting an A record for the root domain. Noting that I did NOT test this via the MAAS CLI, so I'm unsure if this is simply a UI problem or an API problem.
Using:
---
:~# snap list maas
Name Version Rev Tracking Publisher Notes
maas 3.3.3-13184-
---
Let me know if I can provide any more info on this! Thanks!
even using the CLI, only option #2 works.
the function separate_fqdn() is used by 'dnsresources' and 'dnsresource- records' , but the django forms have different validation rules in each case.
We should review this to make the experience more consistent.