Registrar: glue records for in-bailiwick name servers #87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "registrar-glue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Salt's registrar module sent name servers as host names only. A domain served by name servers under itself (in bailiwick, e.g.
trouweherverdeling.nlonns1.trouweherverdeling.nl) needs glue: the registry cannot find those servers without their addresses. This adds glue toregister,transferandset_name_servers, through the module API and the HTTP registrar API.What changed
SaltDns.Registrar.NameServers(new). Normalises a plain host name or a map/struct withname, optionalipv4andipv6; validates both address forms and normalises them (IPv4 4-tuple / IPv6 8-tuple, canonical text).prepare/3enforces bailiwick and carries stored glue forward.SaltDns.Registrar).register/transferandset_name_serversvalidate and normalise entries before anything is written or sent. In-bailiwick without an address is{:error, {:invalid, ...}}and nothing is sent. Out-of-bailiwick with an address is refused (not silently dropped) because registries ignore or refuse it; silent data loss was the hazard this change exists to remove. The addresses are stored in the newregistrar_domains.name_server_addresses(migration20261128090000, new column with a default);sync_domainkeeps what the registrar reports; a laterset_name_serversnaming the same server without an address carries its glue forward.reference_reuse. Plain-name requests keep their old fingerprint (no forced rehash of existing operations).domainNameservershape:{"name": ..., "ip": <IPv4>, "ip6": <IPv6>}. Field names confirmed fromhttps://developer.openprovider.com/data/swagger.json(definitionsdomainNameserver/ns_groupNameServersSet).seq_nris optional there and is not sent: array order gives the sequence, and plain names are sent exactly as before. A domain read keepsip/ip6.PUT /registrar/domains/{fqdn}accepts optionalname_servers(strings or{name, ipv4, ipv6}objects);PUT /registrar/domains/{fqdn}/name-serversreplaces them. Domain answers gainname_server_addresses. OpenAPI anddocs/integrations/registrar.mdupdated; "Glue" section added todocs/registrar.md; CHANGELOG updated.Acceptance criteria
name, optionalipv4, optionalipv6accepted.{:error, {:invalid, ...}}, nothing sent.name/ip/ip6; plain names unchanged.sync_domainkeeps addresses; a laterset_name_serversdoes not drop stored glue.Checks run
mise exec -- mix precommit— passed (hex.audit, format check, compile warnings-as-errors, deps.unlock, credo --strict, sobelow, deps.audit,mix test --warnings-as-errors): 1567 passed (49 properties, 1518 tests), 1696 excluded.mise exec -- mix coveralls— passed, total 90.5%; newname_servers.ex93.0%.MIX_ENV=dev mise exec -- mix docs --warnings-as-errors— passed.mix test --only integrationforregistrar_test.exs,registrar_controller_test.exs,registrar_worker_test.exs): 174 passed.:integrationsuite (it needs the complete Knot/PowerDNS/BIND stack, not only Postgres).No deployment, no live Salt or Openprovider calls.
🤖 Generated with Claude Code
A name server passed to register, transfer or set_name_servers may now be a plain host name (as before) or an entry with name, ipv4 and ipv6. A name server that is the domain itself or under it needs an address; an address on one outside the domain is refused rather than dropped. The Openprovider adapter sends the addresses as ip and ip6 (the registrar's own domainNameserver field names), and a domain read back keeps the addresses in registrar_domains.name_server_addresses (migration 20261128090000, a new column with a default). A later set_name_servers that names a stored server without an address carries its glue forward, and the addresses are part of a spending call's fingerprint. The HTTP registrar API accepts name_servers on PUT /registrar/domains/{fqdn} and has PUT /registrar/domains/{fqdn}/name-servers; both are in the OpenAPI document. Docs: the new "Glue" section of docs/registrar.md. Co-Authored-By: Claude Code <noreply@anthropic.com>