| Member | Does |
|---|---|
| check() | Re-reads the zone. This is what moves status. |
| migration() | Would switching now break anything? |
| serve() · unserve() | Make a hostname actually serve. |
| remove() | Detach it. |
| records | list · set · remove · import. |
enable · status · hosts · dmarc · bimi · disable. | |
| attach() · attachments() | Put a host of the account behind the name. |
| redirects | Send www — or the root — somewhere else. |
| owner() · tls() | The registry's view, and the certificates. |
| dnssec · verify() | Sign the zone; prove the domain to a service. |
What it carries
namestringThe domain.
statusstringpending_nameservers until the registrar points here; active after.
nameserversstring[]What to set at the registrar. Read them; never hardcode a pair.
dnsobject{ mxOk, spfOk, dkimOk, dmarcOk, checkedAt } — the mail witnesses.
importedobject{ found, added, at } — what the takeover found and copied.
mailHostsarrayHosts where mail is enabled, each with its selector and its witnesses.
registrarstringWho registered it.
A host, not just a domain
The apex and a subdomain are separate for mail
Each has its own records, its own key and its own policy — an apex record does not cover a subdomain. mailHosts is a list for that reason, and every mail call takes a subdomain.
The usual sequence
const domain = await api.domains.get("example.com");
await domain.migration(); // safe to switch?
await domain.records.import(); // if not
await domain.check(); // until status is "active"
await domain.mail.enable(); // then maildomain = api.domains.get("example.com")
domain.migration() # safe to switch?
domain.records.import_zone() # if not
domain.check() # until status is "active"
domain.mail.enable() # then mail