const plan = await domain.migration();
if (!plan.safeToSwitch) {
console.log("would break:", plan.risks.join(", "));
await domain.records.import();
}plan = domain.migration()
if not plan["safeToSwitch"]:
print("would break:", ", ".join(plan["risks"]))
domain.records.import_zone()Returns
{
servedBy: ["…", "…"], // who serves the domain right now
nameservers: ["…", "…"], // what to set at the registrar
safeToSwitch: false,
counts: { found: 23, inZone: 0, missing: 15, opaque: 8 },
missing: [{ type, name, content, reason }], // live elsewhere, absent here
opaque: [{ type, name, content, reason }], // a proxy address: the origin is invisible
unseen: [{ type, name, reason }], // seen by querying, not by the search
risks: ["mail in service", "DKIM signature", "a live site"],
alreadyServed: false,
}{
"servedBy": ["…", "…"], # who serves the domain right now
"nameservers": ["…", "…"], # what to set at the registrar
"safeToSwitch": False,
"counts": {"found": 23, "inZone": 0, "missing": 15, "opaque": 8},
"missing": [{"type": ..., "name": ..., "content": ..., "reason": ...}], # live elsewhere, absent here
"opaque": [{"type": ..., "name": ..., "content": ..., "reason": ...}], # a proxy address: the origin is invisible
"unseen": [{"type": ..., "name": ..., "reason": ...}], # seen by querying, not by the search
"risks": ["mail in service", "DKIM signature", "a live site"],
"alreadyServed": False,
}Three views, compared
- What the search found at the current host.
- What the domain answers when it is queried directly.
- What our zone already holds.
A record present in either of the first two and absent from the third is a thing that would stop.
missing and opaque are not the same, and that is the point
Behind a proxy, what you see from outside is the proxy's address, not the origin. Copying it would point the domain at a service that has never heard of it. They are listed separately, and import() skips them.
opaque is counted once per name, not per address: the same name behind a proxy answers different addresses depending on who asks.
risks is the sentence to show
Mail in service, a DKIM signature, a live site — in those words. It is what a customer needs to read before being told to change anything.
alreadyServed
True when the switch is already done. The question no longer applies, and nothing here is a warning.