Samyak2 / netlify-dns-zone-file

Generate a DNS Zone File out of your Netlify DNS Zones. Works for migrating to Cloudflare.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Netlify DNS Zone File Generator

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.

Usage

  1. Create a Netlify Personal Access Token.

Now, you can either Run on Replit or run it locally on your system:

Run on Replit

  1. Open the Repl and click on the play button to run it once.
  2. Export the netlify token as an environment variable:
    export NETLIFY_TOKEN=<your token here>
  3. Run the tool again. The output will contain the names of the .zone files that were generated.
    ./main

Run locally

  1. Clone this repository:
    git clone https://github.com/Samyak2/netlify-dns-zone-file.git
  2. Export the netlify token as an environment variable:
    export NETLIFY_TOKEN=<your token here>
  3. Run the tool. The output will contain the names of the .zone files that were generated.
    go run .

Troubleshooting

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.

Misc

License

MIT

References

About

Generate a DNS Zone File out of your Netlify DNS Zones. Works for migrating to Cloudflare.

License:MIT License


Languages

Language:Go 98.2%Language:Nix 1.8%