MAAS DNS does not permit adding root domain by name

Bug #2023413 reported by Adam Vest
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Status tracked in 3.6
3.5
Won't Fix
Medium
Unassigned
3.6
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-g.3e9972c19 27405 3.3/stable canonical✓ -
---

Let me know if I can provide any more info on this! Thanks!

--
[1] https://github.com/maas/maas/blob/313c7172557ac357a86244ffe7cb72d90efe0aef/src/maasserver/models/dnsresource.py#L68

Revision history for this message
Alexsander de Souza (alexsander-souza) wrote :

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.

Changed in maas:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 3.5.0
Changed in maas:
milestone: 3.5.0 → 3.5.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.