Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
1487cfdd70 | |||
3f818e8ccb |
@ -1,7 +1,13 @@
|
|||||||
|
# pdns-genrev
|
||||||
|
|
||||||
Tool to generate PTR records in reverse zones based off A/AAAA records in forward zones.
|
Tool to generate PTR records in reverse zones based off A/AAAA records in forward zones.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
Requires the following environment variables to be set:
|
Requires the following environment variables to be set:
|
||||||
|
|
||||||
`GENREV_KEY` - the API key defined in the PowerDNS configuration
|
`GENREV_KEY` - the API key defined in the PowerDNS configuration
|
||||||
|
|
||||||
`GENREV_URL` - URL to the PowerDNS webserver, without a path (for example `http://[::1]:8081`)
|
`GENREV_URL` - URL to the PowerDNS webserver, without a path (for example `http://[::1]:8081`)
|
||||||
|
|
||||||
`GENREV_ZONES` - comma separated list of forward zones to scan
|
`GENREV_ZONES` - comma separated list of forward zones to scan
|
||||||
|
@ -45,7 +45,9 @@ def _get(path):
|
|||||||
def _iterate_zone(zone, types, only_records=False):
|
def _iterate_zone(zone, types, only_records=False):
|
||||||
result = {}
|
result = {}
|
||||||
records = []
|
records = []
|
||||||
this_zone = _get(f'zones/{zone}')
|
|
||||||
|
escapedzone = requests.utils.quote(zone, safe='')
|
||||||
|
this_zone = _get(f'zones/{escapedzone}')
|
||||||
|
|
||||||
for rrset in this_zone['rrsets']:
|
for rrset in this_zone['rrsets']:
|
||||||
if rrset['type'] in types:
|
if rrset['type'] in types:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user