await domain.check();
if (domain.status === "active") {
// The registrar points here. The zone is live.
}domain.check()
if domain.status == "active":
pass # The registrar points here. The zone is live.The only thing that moves status
A customer who set the nameservers an hour ago is still pending until something calls this. An interface showing a domain's state should offer the check, or run it when the page opens.
The change takes time to be visible
A registrar change is not instant everywhere. A check right after the customer saves it will usually still say pending — which is correct, not a failure. Check again rather than concluding.
It updates the object
status, dns and the rest are replaced with what came back, and the same instance is returned — so a reference you hold stays current.
It refreshes the mail witnesses too
dns is re-read from the zone. For one host in particular, mail.status() is the narrower call.