Skip to content

vbeskrovny/PDNS-Manager

Repository files navigation

PDNS-Manager

Lightweight PowerDNS management frontend

Intention and prerequisites

  1. During my IT management responsibilities I found some time to contribute to our team of engineers and company overall.
  2. Tired of looking for a decent PowerDNS frontend manager -> let's create our own.
  3. Should be lightweight, dead simple and could be easily modified if needed.
  4. No need for the 3rd party storage databases (MySQL, PostgreSQL, e.t.c. databases), complex frameworks -> direct communication with the PowerDNS using API
  5. Use PHP, HTML and JavaScript (jQuery) only
  6. Some extra security on top (OTP)

What works

  1. Adding and removing zones
  2. Modifying records
  3. Adding records (A, TXT, CNAME, MX, SRV)
  4. DDNS minimal usage (check Wiki as well):

Requirements

  1. PowerDNS
  2. Web server
  3. PHP

Tested on

  1. PHP-FPM: 7.2.4
  2. Ubuntu: 18.04.5
  3. NGINX: 1.14.0

Disclaimer

  1. Use at your own risk
  2. No input data has been validated (apart from adding . (dot) at the end of zones/records), so be careful
  3. If unsure -> add https + basic auth in front of PDNS Manager directory
  4. Feel free to contribute, correct the bugs, add extra functionality

2DO

  • DDNS (via GET)
  • DDNS (via POST)
  • DDNS get IP from source request by default
  • OTP can be turned off by setting secret to 'null' value: e.g. 'user' => array('password' => 'hash', 'secret' => null); and enabled/disabled via settings
  • Protect credentials/token against bruteforcing
  • Validate TXT record to have surrounding quotes
  • Implement TOKEN -> ZONE / RECORD policy
  • Implement USER -> ZONE / RECORD policy
  • Multi-user support (credentials, zones, records)
  • Validate content depending on the record type
  • Pass status codes from PowerDNS API back to application API
  • Cleanup
  • PDNS_Helper -> prepare() -> array
  • Minify everything
  • Possibility to edit settings from the GUI (???)
  • Possibility to edit credentials from the GUI (???)

High level logic overview

High level logic overview


Screenshots

Sign in window

Sign in window


Sign up window

Sign up window


Records editing window

Records editing window


Setup

  1. Clone the project
  2. Configure the web server (NGINX snippet) + enable PHP
location /pdns/api2 {
    root /var/www/pdns.yourdns.com/pdns/api2;                                                                                                                         
    try_files $uri /pdns/api2/index.php$is_args$args;
}

location / {               
    try_files $uri $uri/ =404;
}
  1. Fetch dependencies using composer (check composer.json to see what is needed)
  2. Navigate to https://pdns.yourdns.com -> you should see the login prompt and be able to "sign up"
  3. Save the received credentials to the '-sample.php' files and rename the files (credentials-sample.php and settings-sample.php) by removing '-sample'
  4. Enjoy...

About

Lightweight PowerDNS management frontend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published