Bridge CDN
On this page

What is a DNS zone file?

It's the text form of a zone. Each line holds one record: owner name, TTL, class, type and data (the RDATA). Two directives set defaults for the lines below them. $ORIGIN names the zone, and $TTL sets the TTL for any record that doesn't state its own.

$ORIGIN example.com.
$TTL 3600
@       IN  SOA   ns1.example.net. hostmaster.example.com. ( 2026113001 7200 3600 1209600 300 )
@       IN  NS    ns1.example.net.
@       IN  NS    ns2.example.net.
@       IN  A     203.0.113.10
www     IN  CNAME example.com.
@       IN  MX    10 mx1.example.net.
@       IN  TXT   "v=spf1 include:_spf.example.net -all"
shop    300 IN A  198.51.100.20

@ means the zone apex. A name without a trailing dot is relative, so shop becomes shop.example.com. A name with the dot is complete. That dot matters more than anything else in the file, and we'll come back to it.

Why bother with a zone file when Bridge can scan your public DNS? A scan only finds names it knows to ask about. If you have vpn-old.example.com or a verification record on an odd label, the scan won't see it. Your DNS zone file is the full inventory.

Before you start

  • Get the export. Most DNS hosts offer an "export zone" or BIND zone file download in the DNS settings of the domain. Some call it a zone file, some a BIND file. If yours offers neither, use the Bridge public DNS scan and add the missing names by hand.
  • Check whether the old zone is signed. If DNSSEC is on at the old provider, read the DNSSEC step in the DNS migration checklist before you go further.
  • Don't touch the registrar yet. Importing a zone is safe on its own. The risky step is the nameserver change, and it comes last.

How to import DNS records from a zone file

  1. Open the exported DNS zone file in a text editor. Confirm that $ORIGIN or the owner names match your domain.
  2. Remove the SOA record and the apex NS records. Bridge creates and maintains both, so the old ones would point at the previous provider.
  3. Remove DNSSEC records. DNSKEY, RRSIG, NSEC, NSEC3 and NSEC3PARAM lines belong to the old provider's signatures. Bridge signs the zone itself if you enable DNSSEC later.
  4. Note unsupported types. Bridge DNS accepts A, AAAA, CNAME, MX, TXT, NS, CAA, SRV, HTTPS, SVCB and TLSA. PTR, ALIAS or ANAME, and provider-only "URL redirect" entries won't import. Plan a replacement for each one.
  5. Paste the cleaned file into the zone import screen.
  6. Check for omissions. Compare the imported records with your inventory. Decide whether to omit, recreate or correct any missing entry.
  7. Review the records and save. Decide which A and AAAA records to proxy. Keep mail and verification names DNS-only.

How to check the import before you delegate

If both providers answer authoritatively for the zone, query their nameservers for the same names with dig and compare. Dig is the quickest way to see exactly what each side serves:

dig @ns1.example.net example.com MX +short
dig @ns1.bb-ns.com   example.com MX +short

Do this for the apex, www, mail records, and every TXT record you rely on. Counting records by type in both zones is quicker than reading them line by line, and it catches most gaps. For a proxied A or AAAA record, Bridge returns the edge address, not your server's. That difference is expected.

When the zones match, change the delegation: the nameservers at the registrar. Our guide to changing nameservers at your registrar covers that step. Afterwards, you can verify authoritative and cached answers as resolvers move over.

Why is a record missing after the import?

When a name works at the old host but not in Bridge, it's almost always one of these:

  • A missing trailing dot. www IN CNAME example.com without the dot becomes example.com.example.com. The record exists, just under the wrong target.
  • A skipped type. A PTR, ALIAS or redirect entry never entered the zone. Compare the imported records with the original file.
  • A blank owner name. In a zone file, a line that starts with whitespace inherits the previous line's owner. Editing the file by hand can shift a record onto the wrong name.
  • A delegated subdomain. If dev.example.com was delegated elsewhere with NS records, its records were never in your zone file to begin with.
  • A long TXT value. Values over 255 characters are split into several quoted strings. Make sure they arrived as one record.

Fix the record in the zone editor and query the Bridge nameserver again. You don't need to re-import the whole file.

How to roll back

Until the nameservers change, a rollback isn't needed. The old provider is still answering, and you can delete or re-import the Bridge zone as often as you like. After the change, roll back by putting the old nameservers back at the registrar. Keep the old zone unchanged for 48 hours so it can still answer.

Questions about DNS zone files

What does a DNS zone file look like?

It's a text file with one record per line: name, TTL, class, type and value, plus $ORIGIN and $TTL directives at the top. The BIND zone file layout is the common one, and most providers export in it.

Do I need to remove the SOA record before importing?

Remove it, along with the apex NS records. Bridge DNS creates and maintains its own SOA and NS records at the apex, so the old provider's values have no place in the new zone.

Can I import a zone file that has DNSSEC records in it?

Strip them first. DNSKEY, RRSIG and NSEC records were made with the old provider's keys and are useless elsewhere. Enable DNSSEC in Bridge after the move, then add the new DS record at your registrar.

Is a zone file import better than a public DNS scan?

It's more complete. A scan only finds the names it knows to query, while DNS zone files list every record in the zone. Use the scan when your provider has no export.

Does importing a zone file change my live DNS?

No. Your live DNS changes only when the registrar points the domain at the Bridge nameservers.