await domain.records.set({ type: "CNAME", name: "docs", content: "example.pages.dev" });
await domain.records.set({ type: "MX", name: "@", content: "mx.example.net", priority: 10 });domain.records.set({"type": "CNAME", "name": "docs", "content": "example.pages.dev"})
domain.records.set({"type": "MX", "name": "@", "content": "mx.example.net", "priority": 10})typestringrequiredA, AAAA, CNAME, TXT, MX, SRV, CAA. NS is refused.
namestringrequiredRelative to the zone. @ for the apex.
contentstringrequiredThe value.
prioritynumberMX and SRV.
ttlnumberSeconds. Automatic by default.
replacebooleanReplace every record of that type and name, not only the matching one.
Some types legitimately repeat
So only the one with the same content is replaced — otherwise writing a second mail server would delete the first. Pass replace: true when you genuinely mean « this name now has exactly this ».
NS is refused
A record delegating a name away is exactly what a subdomain takeover looks like. The type is not accepted, with no option to force it.
A record cannot leave the zone
Names are relative, so there is no way to write into a zone that is not this one.
A record does not make a name serve
For a hostname that must actually answer, serve() writes the record and registers the name. A record alone gives an address that resolves and refuses.