My First Own DynDNS
-------------------------------------------------------------------------------
PHP code for a self hosted dynDNS compatible dynamic DNS system

* Author Stefan Onderka
* Contact http://stefanon.de/rka
* http://www.onderka.com/inhalt/eigener-dyndns-mit-bind-apache-und-php/

Requirements
-------------------------------------------------------------------------------
* Bind nameserver
* Apache web server with PHP
* Apache mod_rewrite for DynDNS compatibility ("/nic/update?..." style URLs)

Installation and setup of your nameserver
-------------------------------------------------------------------------------
* Setup Bind on example.com
* Create a zone for your dynamic DNS, for example ddns.example.com
* Create an nsupdate key that is allowed to update your zone
* Set up Bind to allow the created key for updates to the DDNS zone

The setup until here is beyond the scope of this readme. Some hints:

* http://andrwe.org/linux/own-ddns
* http://linux.yyz.us/nsupdate/
* http://blog.philippklaus.de/2013/01/updating-dns-entries-with-nsupdate-or-alternative-implementations-your-own-ddns/

Installation and setup of this software
-------------------------------------------------------------------------------
* Create a vhost like ddns.example.com
* Unpack this archive to the 'DocumentRoot' of your vhost
* Make all files and folders readable, log/ and data/ writeable for Apache
* Configure include/config.php, customize at least:
  * DNS_SERVER - Most likely 127.0.0.1 (localhost)
  * DDNS_ZONE  - The zone, like ddns.example.com, no trailing dot
  * KEY_NAME   - The name of your nsupdate key, like "ddns-update-key-main"
  * KEY_VALUE  - The value of your nsupdate key, like "5FPbxxVasoXxssC+jc1A=="

* Configure include/users.php, USERNAME is also HOSTNAME.ddns.example.com
  * Example: $known_clients['home'] = "home$$pASSw0rd";
  * User "home" / pass "home$$pASSw0rd" is for updating home.ddns.example.com

* Test your system with a browser first
  * Unauthenticated bypassers sinply get their IP displayed.
    http://ddns.example.com/
  * Simple update URL:
    http://ddns.example.com/?name=home&pass=home$$pASSw0rd
  * DynDNS compatible update URL:
    http://ddns.example.com/nic/update?name=home&pass=home$$pASSw0rd
    (Rewriting from /nic/update?... to /index.php?... is done in .htaccess)
  * Shortest way, not supported by many modern web browsers - use cURL etc.:
    http://home:home$$pASSw0rd@ddns.example.com
  * Simple cURL command line:
    curl -v -s "http://home:home$$pASSw0rd@ddns.example.com"

* Server replies per DynDNS protocol (http://www.noip.com/integrate/response):
  * "good IP_ADDRESS"  - Host updated
  * "nochg IP_ADDRESS" - No change since last update
  * "badauth"          - Invalid user/password
  * "911"              - Internal server error, file error or nsupdate error

Files
-------------------------------------------------------------------------------
favicon.ico            - An icon. You guessed it. Ripped from DynDNS
index.php              - Main php file
.htaccess              - Basic settings and rewriting of DynDNS protocol URLs
data/${client}.ip      - Stored client IPs
data/.htaccess         - Folder protection
include/config.php     - PHP system configutation
include/functions.php  - PHP functions
include/users.php      - DynDNS user setup
include/.htaccess      - Folder protection
log/debug.log          - Log for debugging
log/events.log         - Log for events
log/.htaccess          - Folder protection
