#!/bin/sh : ${pdns_port:='1053'} : ${pdns_distributor_threads:='3'} : ${pdns_receiver_threads:="$nproc"} : ${pdns_allow_axfr_ips:='127.0.0.1/8'} : ${pdns_cache_ttl:='30'} : ${pdns_query_cache_ttl:='20'} : ${pdns_negquery_cache_ttl:='60'} pdns_conf_dir=/usr/local/etc/pdns pdns_runtime_dir=/var/run/pdns pdns_soa_record="sOARecord: ${fqdn} root.${domain} 0 10800 3600 604800 3600" pdns_ns_records=$(printf "nSRecord: %s.${domain}\n" $idm_hostnames) pdns_user=pdns # Install PowerDNS. pkg install -y powerdns # Generate PowerDNS configuration. install_template -m 0644 "${pdns_conf_dir}/pdns.conf" # Enable PowerDNS and start it. sysrc -v pdns_enable=YES service pdns restart # Create initial IDM DNS records. if is_primary_server; then # ou=dns,dc=example,dc=com ldap_add "$dns_basedn" <