How to Export Your Domain's DNS Records from Vercel

Learn how to utilize our API to export your domain's DNS records from Vercel.
Last updated on October 23, 2024
Domains & DNS

If you need to export your DNS records while using Vercel as your DNS provider, you can do this easily through our API. This might be useful if you want to move to another DNS provider or have a backup of your zone file.

To begin, you will need your Team ID. You can find this by navigating to Settings > General and then find the module Team ID. Make sure to note down the ID for later.

Next, you will need an API token to access the API. Follow this guide to learn how to generate a token: How to Use a Vercel API Access Token. Remember that the API token is only visible once, so also note this down.

Once you have your API token, you can retrieve your DNS records by using the following endpoint or command (e.g., via cURL):

curl -X \
GET "https://api.vercel.com/v4/domains/<your-domain>/records?teamId=<your-team-id>" -H \
"Authorization: Bearer <vercel-auth-token>" -H \
"Accept: text/dns"
cURL command to generate a zone file
  • Replace <your-domain> with the domain name you want to export records for.
  • Replace <your-team-id> with your complete Team ID (including the team_ prefix).
  • Replace <vercel-auth-token> with the API token you generated.

This will return the DNS records for the specified domain in the following format:

; Zone: example.dev.
$ORIGIN example.dev.
$TTL 60
; SOA Record
example.dev. IN SOA example.dev. team.zeit.co. (
2024102312 ;serial
7200 ;refresh
900 ;retry
1209600 ;expire
60 ;minimum ttl
)
; NS Records
@ IN NS ns1.vercel-dns.com.
@ IN NS ns2.vercel-dns.com.
; CAA Records
@ IN CAA 0 issue "letsencrypt.org"
; MX Records
; A Records
example.dev. IN A 76.76.21.21
; AAAA Records
; ALIAS Records
; CNAME Records
www.example.dev. IN CNAME cname.vercel-dns.com.
; HTTPS Records
; PTR Records
; TXT Records
example.dev. IN TXT "value"
; SRV Records
; SPF Records
Zone file generated from API

The output can then be imported into other DNS services if needed.

Couldn't find the guide you need?