PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.61k stars 900 forks source link

Allow to configure PowerDNS via PDNS_ variables at docker-compose.yml #12176

Open KES777 opened 1 year ago

KES777 commented 1 year ago

Short description

It would be handy if:

Any setting from https://doc.powerdns.com/3/authoritative/settings/ is supported. Just add the prefix "PDNS" and replace any hyphens (-) with underscore (). Example: allow-axfr-ips ===> PDNS_ALLOW_AXFR_IPS

Like here https://hub.docker.com/r/arzahsze/docker-powerdns

Or like here: https://hub.docker.com/r/hub4rpi64/powerdns-authoritative-server

Usecase

services:
  auth:
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
    build:
      context: ./
      dockerfile: Dockerfile-auth
    volumes:
      - ./pdns.conf:/etc/powerdns/pdns.conf
      - pdns-run:/var/run/pdns
      - pdns-data:/var/lib/powerdns
    environment:
      PDNS_GPGSQL_PASSWORD: $PDNS_DB_PASSWORD
      PDNS_LOGLEVEL: 10
KES777 commented 1 year ago

https://computingforgeeks.com/running-powerdns-and-powerdns-admin-in-docker-containers/

Another example with prefixes

pdns:
    #build: pdns
    image: pschiffe/pdns-mysql
    hostname: pdns
    domainname: computingforgeeks.com
    restart: always
    depends_on:
      - db
    links:
      - "db:mysql"
    ports:
      - "53:53"
      - "53:53/udp"
      - "8081:8081"
    environment:
      - PDNS_gmysql_host=db
      - PDNS_gmysql_port=3306
      - PDNS_gmysql_user=pdns
      - PDNS_gmysql_dbname=powerdnsadmin
      - PDNS_gmysql_password=mypdns
      - PDNS_master=yes 
      - PDNS_api=yes
      - PDNS_api_key=secret 
      - PDNSCONF_API_KEY=secret 
      - PDNS_webserver=yes 
      - PDNS_webserver-allow-from=127.0.0.1,10.0.0.0/8,172.0.0.0/8,192.0.0.0/24 
      - PDNS_webserver_address=0.0.0.0 
      - PDNS_webserver_password=secret2 
      - PDNS_version_string=anonymous 
      - PDNS_default_ttl=1500 
      - PDNS_allow_notify_from=0.0.0.0 
      - PDNS_allow_axfr_ips=127.0.0.1