Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1487cfdd70 | |||
3f818e8ccb | |||
850556ab7d |
@ -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:
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
|
# This file is part of the pdns-genrev package
|
||||||
|
# Author: Georg Pfuetzenreuter <mail+opensuse@georg-pfuetzenreuter.net>
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=PowerDNS reverse zone update
|
Description=PowerDNS reverse zone update
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
User=pdns-genrev
|
||||||
EnvironmentFile=/etc/sysconfig/pdns-genrev
|
EnvironmentFile=/etc/sysconfig/pdns-genrev
|
||||||
ExecStart=/usr/bin/pdns-genrev $ARGS
|
ExecStart=/usr/bin/pdns-genrev $ARGS
|
33
suse/pdns-genrev.sysconfig
Normal file
33
suse/pdns-genrev.sysconfig
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# This file is part of the pdns-genrev package
|
||||||
|
# Author: Georg Pfuetzenreuter <mail+opensuse@georg-pfuetzenreuter.net>
|
||||||
|
|
||||||
|
## Description: pdns-genrev configuration
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: not set
|
||||||
|
#
|
||||||
|
# PowerDNS API Key
|
||||||
|
#
|
||||||
|
GENREV_KEY=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: "http://[::1]:8081"
|
||||||
|
#
|
||||||
|
# PowerDNS web server
|
||||||
|
#
|
||||||
|
GENREV_URL="http://[::1]:8081"
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: not set
|
||||||
|
#
|
||||||
|
# Comma separated list of forward DNS zones
|
||||||
|
#
|
||||||
|
GENREV_ZONES=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: "--wet"
|
||||||
|
#
|
||||||
|
# Command line arguments to pass
|
||||||
|
# Add "--notify" here if primary/secondary replication is used
|
||||||
|
#
|
||||||
|
ARGS="--wet"
|
1
suse/pdns-genrev.system-user
Normal file
1
suse/pdns-genrev.system-user
Normal file
@ -0,0 +1 @@
|
|||||||
|
u pdns-genrev - "PowerDNS reverse zone helper" /var/lib/empty -
|
Loading…
x
Reference in New Issue
Block a user