For every interface MAAS is adding an A record for the name <machine>.<domain>

Bug #2046255 reported by Jacopo Rota
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Jacopo Rota
3.3
Fix Released
Critical
Jacopo Rota
3.4
Fix Released
Critical
Jacopo Rota
3.5
Fix Released
High
Jacopo Rota

Bug Description

In different solqa runs (for example https://solutions.qa.canonical.com/testruns/fa952c11-c459-4eb2-82b6-e51b737dbef3), in a discourse post (https://discourse.maas.io/t/hosts-w-multiple-ips-have-multiple-a-records-created-v3-3-3/7651/8) and also on the reporter's homelab MAAS >= 3.3 is creating multiple A records for the name <machine>.<domain>. As a consequence, the dns resolution returns wrong data

```
dig @localhost ciscom4.maas

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> @localhost ciscom4.maas
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60108
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: f2c0be5af22ac4af0100000065785290f03797615562001b (good)
;; QUESTION SECTION:
;ciscom4.maas. IN A

;; ANSWER SECTION:
ciscom4.maas. 30 IN A 192.168.1.222
ciscom4.maas. 30 IN A 172.0.2.11
```

(172.0.2.11 is the address on the boot interface, 192.168.1.222 is the address on the second interface).

The expected behaviour is that MAAS creates only one A record for the boot interface that resolves <machine>.<domain>.
For all the other interfaces, MAAS should create a dns record like <nic>.<machine>.<domain> that resolves to that interface's address.

In MAAS 3.2 the observed behaviour is correct:
```
r00ta@r00ta-ThinkPad-T420:~/repos/maas-matrix-tests$ dig @localhost ciscom4.maas

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> @localhost ciscom4.maas
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12068
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: f229d1e1531ca4d301000000657858e8e491652723980002 (good)
;; QUESTION SECTION:
;ciscom4.maas. IN A

;; ANSWER SECTION:
ciscom4.maas. 30 IN A 172.0.2.11

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(localhost) (UDP)
;; WHEN: Tue Dec 12 13:58:16 CET 2023
;; MSG SIZE rcvd: 85

r00ta@r00ta-ThinkPad-T420:~/repos/maas-matrix-tests$ dig @localhost enp1s0f1.ciscom4.maas

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> @localhost enp1s0f1.ciscom4.maas
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42539
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 103a5f56c262636601000000657858ebccee4b5cccda9899 (good)
;; QUESTION SECTION:
;enp1s0f1.ciscom4.maas. IN A

;; ANSWER SECTION:
enp1s0f1.ciscom4.maas. 30 IN A 192.168.1.222

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(localhost) (UDP)
;; WHEN: Tue Dec 12 13:58:19 CET 2023
;; MSG SIZE rcvd: 94
```

### STEPS TO REPRODUCE

1) install maas
2) commission a VM or a server with 2 interfaces
3) Once the machine is commissioned, assign a static IP to the non-boot interface
4) try to resolve <machine>.<domain> with dig

Related branches

Jacopo Rota (r00ta)
description: updated
Jacopo Rota (r00ta)
description: updated
Changed in maas:
milestone: 3.5.0 → 3.5.0-beta1
status: Fix Committed → Fix Released
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.