Created
June 14, 2019 07:28
-
-
Save Chan9390/1cda5d014bf5910412db25dd57a893b9 to your computer and use it in GitHub Desktop.
Python script to get all DNS records from all Cloudflare zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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