Skip to content

Use the standard DNS SOA format#2843

Merged
stgraber merged 4 commits intolxc:mainfrom
dankm:dns-soa
Jan 22, 2026
Merged

Use the standard DNS SOA format#2843
stgraber merged 4 commits intolxc:mainfrom
dankm:dns-soa

Conversation

@dankm
Copy link
Copy Markdown
Contributor

@dankm dankm commented Jan 22, 2026

Update the DNS zone template to use the first entry in dns.nameservers as the primary server, and allow specifying the zone's contact address.

Previously if dns.nameservers was unset the SOA record used the zone name in the MNAME field, and hostmaster.zone_name in the RNAME field. That's as correct as can be considering we have no way to know the primary server's name. However, if dns.nameservers was set, the MNAME field still contained the zone name, and the RNAME field was the name of the primary server. That can cause confusion if downstream servers need to know the primary server's name.

The new behaviour uses the first entry in dns.nameservers as MNAME, and the new dns.contact value as RNAME if set.

@dankm dankm requested a review from stgraber as a code owner January 22, 2026 00:39
dankm and others added 4 commits January 21, 2026 22:40
Up until now, the SOA format returned by the internal DNS server
used the zone's name for the primary dns server field, and either
the first dns.nameservers entry or hostmaster.{.zone} for the contact
address.

Instead, use the first entry in dns.nameservers for the master dns
server if set, and adjust the contact address accordingly.

Old SOA entry (no dns.nameserver set):
incus.example.com. 3600 IN SOA incus.example.com. hostmaster.incus.example.com. 1769025229 120 60 86400 30

Old SOA entry (with dns.nameserver set):
incus.example.com. 3600 IN SOA incus.example.com. ns1.example.com. 1769025229 120 60 86400 30

New SOA entry (no dns.nameserver set):
incus.example.com. 3600 IN SOA incus.example.com. hostmaster.incus.example.com. 1769025229 120 60 86400 30

New SOA entry (with dns.nameserver set):
incus.example.com. 3600 IN SOA ns1.example.com. hostmaster.ns1.example.com. 1769025229 120 60 86400 30

Signed-off-by: Dan McGregor <[email protected]>
Adds a new `dns.contact` configuration option to zones.

Signed-off-by: Dan McGregor <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
Signed-off-by: Stéphane Graber <[email protected]>
@github-actions github-actions bot added Documentation Documentation needs updating API Changes to the REST API labels Jan 22, 2026
@stgraber stgraber merged commit 8b40709 into lxc:main Jan 22, 2026
106 of 108 checks passed
@dankm dankm deleted the dns-soa branch January 22, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API Documentation Documentation needs updating

Development

Successfully merging this pull request may close these issues.

2 participants