How does MAAS pick an IP address for the DNS record

Whenever a machine host multiple IP addresses, the logic of which IP address gets assigned to the machine’s main DNS record (hostname.domain-name) is murky and seems to lack controls. This was raised here earlier. It was said in that topic that MAAS will assign the IP address of the boot interface to the DNS record. However, this breaks down especially in bonded scenarios. Take for example this scenario:

Here the PXE boot happens on NIC ens51f0np0 over the default VLAN. During OS installation, the above config gets populated into the netplan config for after the reboot. We don’t leave a PXE IP address in this config and both NICs are bonded. The machine’s primary IP is 10.0.72.19 and it has an additional storage IP (10.0.64.5).

Originally the storage subnet also defined DNS servers, which seems to cause that IP to be included in the list of IPs that MAAS can pick from for the main DNS record. I have since cleared that configuration, now the 10.0.64.x subnet no longer sets any DNS config and that seems to have removed the possibility that new servers can have an IP from this subnet set to the main DNS record for the server.

However this server above was deployed before that change was made, and it resulted in a main DNS record of 10.0.64.5, which is not desired.

Some questions I have:

  • Is there any logic to how MAAS decided on the IP address to use for the machine’s main DNS record?
  • Are any IPs for the machine excluded from consideration under certain circumstances (e.g. by not setting a DNS server in the subnet)?
  • Is there any way to set a preference or order for which subnet should be picked from first?
  • Is there any way to change the IP address for the main DNS record after the server is deployed? As this main record is not a dnsresource-record, I couldn’t find a way to change it.

I think there is a need for more control over this, as it impacts the usability of the deployed infrastructure.