Skip to content

Getting started

How DNS migration works

See how DNS migration works inside DNSMigrator: canonical records, capability-aware translation, live change plans, authoritative checks, and scoped rollback.

6 min read

On this page

How does a DNS migration work?#

StageInputOutputWrites?
ReadProvider API, AXFR/IXFR, or BIND textCanonical zoneNo
NormalizeCanonical recordsStable names, values, record sets and orderNo
TranslateCanonical zone plus destination capabilitiesPer-record status, notes and destination recordNo
PlanDesired destination records plus live destinationCreate, update, delete and unchanged setsNo
ApplyReviewed fingerprint plus a fresh destination readMatching operations and a snapshot, or a stale-plan stopDestination only
VerifyPlanned records plus destination authoritative nameserversPass, fail or informational resultsNo
Cut overVerified destination plus registrar stateNew delegation and, when needed, a DNSSEC transitionRegistrar; source only if TTL lowering is selected

The web migration flow runs these stages through background jobs. The local CLI exposes the same parser, normalizer, translator and diff engine for credential-free checks, but it never applies provider changes.

Canonical zone model#

A provider may call the same concept an RRset, record group, entry or answer. DNSMigrator represents it as a record set with these core fields:

json
{
  "name": "www.example.com.",
  "type": "A",
  "ttl": 300,
  "values": ["192.0.2.10", "192.0.2.11"]
}

Provider behavior that cannot fit in ordinary RDATA is metadata. The model can retain proxy state, aliases to provider resources, routing policy, and comments. Provider adapters map the fields they support into this model on read and back into provider operations on write.

Normalization makes comparisons stable:

  • Zone and owner names become fully qualified names with a trailing dot. Unicode labels are converted to their IDNA ASCII form.
  • Type-specific values are canonicalized, deduplicated and sorted.
  • Rows with the same owner, type and routing set identifier merge into one record set.
  • When merged rows disagree on TTL, the lower TTL is retained.
  • Records are sorted by name and type so comparisons and exports are reproducible.

Normalization does not claim that every provider can store every field. Capability checks happen during translation or provider planning.

Capability-driven translation#

Each catalog entry describes the destination’s accepted record types, TTL range, TXT limit, apex alias behavior, routing policies, proxy support, DNSSEC support and other API constraints. translateZone evaluates each normalized source record against that catalog entry.

StatusMeaning
ExactThe destination representation needs no change or note.
TranslatedA safe, explicit conversion was made, such as clamping a TTL or storing obsolete SPF data as TXT.
WarningA destination record can be produced, but behavior may change and requires review.
UnsupportedNo safe destination record was produced. The reason is attached to the row.
SkippedThe provider owns the record, such as SOA, DNSKEY or apex NS in the migration translator.

Translation handles more than type names. It converts aliases to a destination-native alias or CNAME, can use resolved addresses supplied by the caller, and removes source-only proxy metadata when the destination has no proxy. Weighted, latency, failover, geo, and multivalue routing stay attached when the destination advertises the same policy; otherwise they flatten with a Review note. Compatible redirect formats are converted among URLFWD, PORKBUN_URLFWD, BUNNY_DNS_RDR, URL, and URL301, with any lost behavior listed. Provider-only features are blocked when there is no equivalent.

A warning is intentionally not “close enough.” For example, replacing an apex alias with current static addresses produces a usable A record but loses automatic address tracking. Read Translation rules and Previews and record statuses for the individual cases.

Change planning#

The translated target says what DNSMigrator wants. A change plan says how the destination differs right now. Records are keyed by owner, type and routing identifier, then divided into four groups:

  • Create: desired record set is absent.
  • Update: the key exists, but TTL, values or relevant metadata differs.
  • Delete: the record exists only at the destination and exact-copy mode allows deletion.
  • Unchanged: the destination already has the desired representation.

Keep extra records uses merge mode and does not populate the delete set. Make an exact copy uses mirror mode. SOA, DNSKEY and apex NS records are excluded from ordinary migration diffs because providers manage them. Managed-zone planning handles declared nameservers separately and applies ignore rules, catalog capability checks, and purge settings before producing a plan. Desired records are normalized to the representation each provider will actually store, including TTL clamping and automatic TTL, so those adjustments do not recur as permanent drift.

Provider writes are not transactional. An adapter can accept some operations and reject others, so a partial apply records the successful subset for rollback and reports the failures in Activity.

Preview and reviewed-plan matching#

A migration preview reads the source, stores a source snapshot, translates it, and reads the existing destination when one exists. Zone-transfer sources also receive transfer-loss analysis. A managed-zone preview performs a provider-normalized comparison for every configured provider.

Each preview receives a SHA-256 fingerprint over its create, update, and delete operations, including TTLs, values, and relevant metadata. Download plan exports the same evidence as Markdown, CSV, or JSON. The default update and delete limits are 30% when at least 10 live record sets exist; plans above a limit require a typed force acknowledgement. Block when records can't be represented can also require an explicit acknowledgement for unsupported records and lost routing or proxy behavior.

Apply ensures the destination zone exists, reads it again, stores the pre-apply snapshot, and recalculates the plan. The fresh fingerprint must equal the reviewed fingerprint. If it does not, record writes stop and the UI offers Review again. Managed-zone push enforces the same match across provider plans and any registrar nameserver step.

See Apply and verify and Preview and push for each workflow’s confirmation gates.

Authoritative verification#

Verification bypasses recursive-cache ambiguity by querying nameservers reported for the destination zone. For literal records, the normalized observed value set must exactly equal the planned set. Missing and unexpected values are reported separately.

Aliases need a different check. An ALIAS, apex CNAME or provider-resource alias is queried as A or AAAA. An empty answer fails. When a source authoritative answer is available, equal address sets pass; different non-empty sets are informational because CDNs and load balancers can legitimately return different addresses. Initial failures are retried before the migration returns to an applied state with mismatches visible. When Publish a verification record is enabled, _dnsmigrator carries the destination provider and short plan fingerprint; cutover checks that answer separately at every new nameserver.

Verification proves what the destination authoritative servers answer. It does not change the public delegation. That happens later in Nameserver cutover.

Rollback scope#

DNSMigrator stores both the destination snapshot and the subset of operations that actually succeeded. Rollback builds an inverse plan from that subset:

  • a created record is deleted only if it still equals the value DNSMigrator wrote;
  • an updated record is restored only if it still equals the post-migration value;
  • a deleted record is recreated only if its key is still absent.

A record changed out of band after apply is skipped and reported. This is why rollback is narrower than restoring the whole snapshot. Read Rollback.

Zone-file and config-as-code input#

The BIND parser understands $ORIGIN, $TTL, $GENERATE, owner inheritance, parentheses, comments, and duration-style TTLs. $GENERATE supports ranges, steps, offsets, decimal/octal/hex formatting, and nibble mode, with a 65,536-record expansion limit. $INCLUDE and other directives still produce line errors. DNSSEC signing records that should not move between providers, including RRSIG and NSEC families, are ignored on import.

Serialization emits normalized BIND text. Provider-resource aliases with no zone-file representation are emitted as comments, and unsupported translated records are omitted from downloadable migration files with the report as the explanation. See BIND zone files.

Under Config as code, a managed zone can import and export octoDNS YamlProvider files, including split files, dynamic weighted/geo/failover data where representable, Route 53 aliases, and Cloudflare proxy state. Starter config generates a config.yaml with env/ placeholders rather than secrets. The CLI can convert among BIND, octoDNS YAML, and dnsconfig.js.