When prefix length for the subnet is less than a /24, MAAS generates glue records (see https://github.com/maas/maas/blob/master/src/maasserver/dns/zonegenerator.py#L482-L509), where it returns a PTR record pointing to another PTR for the corresponding /24.
Clients usually automatically resolve PTRs until they get a meaningful record (A, AAAA, CNAME).
The magpie charm should probably do the same, checking what kind of result is returned by dig, and resolving again if it's a PTR.
When prefix length for the subnet is less than a /24, MAAS generates glue records (see https:/ /github. com/maas/ maas/blob/ master/ src/maasserver/ dns/zonegenerat or.py#L482- L509), where it returns a PTR record pointing to another PTR for the corresponding /24.
Clients usually automatically resolve PTRs until they get a meaningful record (A, AAAA, CNAME).
The magpie charm should probably do the same, checking what kind of result is returned by dig, and resolving again if it's a PTR.