PowerDNS is integrated through the generic DNS service. The PowerDNS connector script facilitates zone management within PowerDNS. Both Native mode and Primary/Secondary mode are supported in the Authoritative PowerDNS.
Prerequisites
- PowerDNS Authoritative DNS Server: Make sure you have PowerDNS installed and running.
- Micetro Agent: Download the Micetro Agent installer package.
Enabling the PowerDNS REST API
- Edit your PowerDNS configuration file to enable the REST
API:
api=yes api-key=bluecat123 webserver-port=8081 - Test the REST API with a curl
command:
curl -v -H 'X-API-Key: bluecat123' http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq .
Configuration steps for mmremoted on Linux
- Install the Micetro Agent:
- Download and extract the Micetro Agent installer package.
- Run the installer as
root:
./install --generic-dns-controllerThis starts the agent, listening on port
1337/TCP.
- Set up a Python environment:
- Install Python 3.12 (or >=3.10) and the required
modules:
pip install python-dotenv requests
- Install Python 3.12 (or >=3.10) and the required
modules:
- Download and configure the Python connector script:
- Download the Python connector script.
- Extract the zip file to get
genericDNSPowerDNSP3.pyandingest_env_vars.py. - Copy both files to /var/mmsuite/dns_server_controller.
- Edit the preferences configuration:
- Edit
/var/mmsuite/dns_server_controller/preferences.cfg
and add the XML
tag:
<GenericDNSScript value="/usr/bin/python3.12 /var/mmsuite/dns_server_controller/genericDNSPowerDNSP3.py" />
- Edit
/var/mmsuite/dns_server_controller/preferences.cfg
and add the XML
tag:
- Create and configure environment variables:
- Create an
mmremotedefaults file, for example, /etc/sysconfig/mmremote on RHEL, and add the necessary environment variables.BASE_URL="http://localhost:8081/" # your PDNS REST API base URL SERVER="localhost" # the server instance name API_KEY="bluecat123" # the API secret configured in the PDNS config PDNS_DEFAULT_TTL="3600" # your DEFAULT TTL value LOG_LEVEL="INFO" # INFO or DEBUG are supported as log level LOG_FILE_NAME="/tmp/mmGenericDNSPowerDNS.log" # log file path
- Create an
- Edit the
mmremoteservice file:- Locate and edit the
mmremote.servicefile, for example, /usr/lib/systemd/system/mmremote.service on RHEL. - Add the
EnvironmentFilestatement that points to the defaults file:[Unit] Description=Men & Mice DNS Server Controller After=syslog.target network.target [Service] Type=forking PIDFile=/var/run/mmremoted/mmremoted.pid Environment=USER=root Environment=GROUP=root Environment=DATA=/var/mmsuite/dns_server_controller Environment=PORT=1337 Environment=LOGLEVEL=3 EnvironmentFile=/etc/sysconfig/mmremote ExecStart=/usr/sbin/mmremoted -u ${USER} -g ${GROUP} -d${DATA} -ll${LOGLEVEL} -p ${PORT} KillMode=process
- Locate and edit the
- Reload and restart the service:
- REload the
systemddaemon and restart themmremoteservice:systemctl daemon-reload systemctl restart mmremote
- REload the
- Verify the setup:
- Check the /tmp/mmGenericDNSPowerDNS.log file for any issues.
- You can also enable debug mode for more detailed logs.