39 lines
1.4 KiB
Markdown
39 lines
1.4 KiB
Markdown
# CF2PDNS
|
|
|
|
Converts a Cloudflare DNS zone export (BIND format) into CSV for Poweradmin's **Bulk add records** form.
|
|
|
|
## Usage
|
|
|
|
```
|
|
python3 cf2pa.py <export.txt> [more exports...]
|
|
```
|
|
|
|
The CSV is written to stdout and warnings go to stderr. Paste the output into
|
|
*Zone → Bulk add records* in Poweradmin.
|
|
|
|
Output format: `name,type,content,prio,ttl`
|
|
|
|
## What it does
|
|
|
|
- Skips `SOA` and `NS` records (these come from your Poweradmin zone template)
|
|
- Strips Cloudflare `cf_tags` comments and trailing dots
|
|
- Converts TTL `1` (Cloudflare "Auto") to `3600`
|
|
- Moves the MX/SRV priority into the `prio` column
|
|
- Escapes TXT quotes for CSV (`"..."` → `"""..."""`), keeping multi-string TXT (e.g. DKIM) intact
|
|
|
|
## Warnings (records not converted)
|
|
|
|
- **Apex CNAME**: Cloudflare flattens it, but standard DNS doesn't allow it. Add an `A`/`AAAA` record manually.
|
|
- **PTR records named `*.arpa.<zone>`**: these have no effect inside a forward zone. Set reverse DNS with your IP provider.
|
|
|
|
## Migration checklist
|
|
|
|
1. Disable DNSSEC at Cloudflare first and wait at least a day for the DS record's TTL to expire.
|
|
2. Create the zone in Poweradmin as **Master** using the NS template.
|
|
3. Bulk-import the CSV and verify that the secondary has the zone: `dig +short SOA <zone> @<ns2>`
|
|
4. Change the nameservers at the registrar.
|
|
5. Delete the Cloudflare zone a day later.
|
|
## License
|
|
|
|
[0BSD](LICENSE): do whatever you want with it. If it breaks your DNS, you get to keep both pieces.
|