Skip to content

Instantly share code, notes, and snippets.

@Chan9390
Created June 14, 2019 07:28
Show Gist options
  • Save Chan9390/1cda5d014bf5910412db25dd57a893b9 to your computer and use it in GitHub Desktop.
Save Chan9390/1cda5d014bf5910412db25dd57a893b9 to your computer and use it in GitHub Desktop.
Python script to get all DNS records from all Cloudflare zones
import CloudFlare
cf = CloudFlare.CloudFlare()
zones = cf.zones.get()
for zone in zones:
for record in cf.zones.dns_records.get(zone['id'], params={'per_page':100}):
print record['name'] + ',' + record['type'] + ',' + record['content']
@alfredocambera
Copy link

I also write a gist that paginates over all the zones and available DNS records. It generates the output is CSV format

https://gist.github.com/alfredocambera/6349b363750beabdf73683bd6c1d94db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment