Skip to content

apisnetworks/apiscp-dns-powerdns-parking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

PowerDNS Parking

A sample module that sets the origin to a parking IP address upon deletion.

Usage

  1. Clone this repo.
cd /usr/local/apnscp
git clone https://github.com/apisnetworks/apiscp-dns-powerdns-parking config/custom/powerdns-parking
sudo -u apnscp ./composer dumpautoload
  1. Register the DNS provider, called "powerdns-parking" in config/custom/boot.php.
\Opcenter\Dns::registerProvider('powerdns-parking', \apisnetworks\custom\powerdns\Module::class);
  1. Set the parking IP in config.ini.
# Set parking IP
cpcmd scope:set cp.config dns parking_ip 1.2.3.4
# Fast-forward pending restart
systemctl restart apiscp
  1. Replace "powerdns" with "powerdns-parking" for all applicable accounts. Iterate over a collection to do this quickly.
cpcmd -o json admin:collect '[]' '[dns.provider:powerdns]' | jq -r 'keys[]' | \
    while read -r SITE ; do 
	    EditDomain -c dns,provider=powerdns-parking $SITE
    done

Notes

  • Requires ApisCP v3.2.34 or later.
  • Nameservers configured for PowerDNS must be valid. These are queried directly to determine parking IP presence.
  • Parking IP is a single address.
  • All records are emptied on deletion replacing the zone with a single IP address for the origin.
  • Written as a work order. IP verification still uses newacct subdomain; this logic is adapted elsewhere.

About

PowerDNS with parking implementation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages