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"
- Replace
<your-domain>
with the domain name you want to export records for. - Replace
<your-team-id>
with your complete Team ID (including theteam_
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 Recordexample.dev. IN SOA example.dev. team.zeit.co. (2024102312 ;serial7200 ;refresh900 ;retry1209600 ;expire60 ;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 Recordsexample.dev. IN A 76.76.21.21
; AAAA Records
; ALIAS Records
; CNAME Recordswww.example.dev. IN CNAME cname.vercel-dns.com.
; HTTPS Records
; PTR Records
; TXT Recordsexample.dev. IN TXT "value"
; SRV Records
; SPF Records
The output can then be imported into other DNS services if needed.