for (const domain of await api.domains.list()) {
console.log(domain.name, domain.status, domain.mailHosts.length, "mail hosts");
}for domain in api.domains.list():
print(domain.name, domain.status, len(domain.mail_hosts), "mail hosts")status is the thing to show
| status | Means |
|---|---|
pending_nameservers | The registrar does not point here yet. The zone serves nothing. |
active | It does. Everything in the zone is live. |
It is refreshed by check(), not by listing — a list shows what was last known.
dns carries the mail witnesses
domain.dns; // { mxOk, spfOk, dkimOk, dmarcOk, checkedAt }domain.dns # {"mxOk", "spfOk", "dkimOk", "dmarcOk", "checkedAt"}Four booleans saying what the zone actually holds for mail. All four true is what « it works » means here.
Pending domains are worth separating
const waiting = (await api.domains.list()).filter((d) => d.status === "pending_nameservers");waiting = [d for d in api.domains.list() if d.status == "pending_nameservers"]A domain that has been pending for days usually means the customer never made the change — which nothing else will tell you.