Import and export BIND zone files
maincli53 supports importing and exporting records using the BIND format.
Importing
- Standard Import:
cli53 import --file <file> <domain> - Replace existing records:
cli53 import --file <file> --replace --wait <domain> - Upsert (Add new, keep existing):
cli53 import --file <file> --upsert <domain> - Dry-run: Add
--dry-runto see what would happen without making changes. - Validate syntax:
cli53 validate --file <file>
Exporting
- Standard Export:
cli53 export <domain> - Full FQDN Export: Use
--fullto export fully-qualified domain names instead of prefixes.
Troubleshooting CNAMEs: If importing from providers like GoDaddy, ensure CNAME/MX records have a trailing dot. If they don't, use this regex to fix them:
perl -pe 's/((CNAME|MX\s+\d+)\s+[-a-zA-Z0-9._]+)(?!.)$/$1./i' broken.txt > fixed.txtcli53 import --file zonefile.txt --replace --wait --dry-run example.com
cli53 export --full --debug example.com > example.com.txt 2> example.com.err.log