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 DNS records.
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 list existing DNS records API endpoint. Here's an example curl command:
curl -X \ GET "https://api.vercel.com/v4/domains/<your-domain>/records?teamId=<your-team-id>&limit=100" -H \ "Authorization: Bearer <vercel-auth-token>"- 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. Please note that the maximum number of records returned is 100. If your domain has more than 100 records, see the API pagination documentation on how to retrieve all records.