This script processes ZIP archives containing DNS export files and generates a merged CSV summary of all discovered zones.
It:
- Extracts
*_dns-config.xmlfiles from ZIP archives in the given directory. - Runs an inline Python parser to read the XML files.
- Collects details such as:
- Server name
- Global forwarders
- Zone type
- Replication settings
- Produces a consolidated CSV file.
./dns_zip2csv.sh <directory-with-zip-files>Example:
./dns_zip2csv.sh ./exports- Works with multiple
.zipfiles in a directory. - Automatically extracts only
*_dns-config.xmlfiles. - Merges all results into a single CSV file for easier analysis.
- Handles case-insensitive
.zipextensions.
- Extracted XML files are placed in:
<directory>/dns_xml_files/ - Merged CSV file is saved as:
<directory>/dns_zones_merged.csv
- Bash
- Tools:
unzippython3(for inline XML parsing)
- ZIP files without
*_dns-config.xmlwill be skipped. - If no ZIP files are found, the script exits gracefully.
- Designed for auditing/exporting Microsoft DNS configurations packaged as ZIP + XML.
This script is covered under the repository’s main MIT License.