Generate a zone file from your Netlify DNS records.
Intended use case: to transfer DNS records from Netlify to Cloudflare (which supports importing a zone file).
How does it work: Netlify does not provide an option to export records to a zone file, but it does provide an API that lists them. This tool uses the data from this API and creates a zone file out of it.
- Create a Netlify Personal Access Token.
Now, you can either Run on Replit or run it locally on your system:
- Open the Repl and click on the play button to run it once.
- Export the netlify token as an environment variable:
export NETLIFY_TOKEN=<your token here>
- Run the tool again. The output will contain the names of the
.zone
files that were generated../main
- Clone this repository:
git clone https://github.com/Samyak2/netlify-dns-zone-file.git
- Export the netlify token as an environment variable:
export NETLIFY_TOKEN=<your token here>
- Run the tool. The output will contain the names of the
.zone
files that were generated.go run .
The tool has only been tested with one domain - when transferring it from Netlify to Cloudflare. The record types that it has been confirmed to handle include A, CNAME, NETLIFY (ignored), MX and TXT.
If you notice errors when importing the generated zone file, please open an issue to report them.
MIT