Skip to content
Krzysztof Królikowski edited this page Sep 12, 2015 · 52 revisions

Dynamic DNS client / server

This is dynamic DNS server and client software. In this version i've made decision to put user accounts into MySQL database instead of unix system accounts. This approach opened a new opportunities. With database we can incorporate some web based user accounts management. Provide IP change history option for users and much more.

Server Requirements

  • Operating system: Linux or FreeBSD
  • DNS software: Bind
  • MySQL database
  • SMTP server (i.e. postfix)
  • Platforms: x86, x86_64

Synopsis

Only authenticated clients are authorized to update particular zonefile. DNS zone with serial number entry should end with comment string:

; serial

White space after semicolon is important!
Client accounts are based on MySQL database contents. Every registered user can add as many domains as he want.

Installation

dDNS server code is linked to MySQL libs. To build server you need to install MySQL devel libs. Source code can be obtained from Download page. You can clone it direcly from Github as well.

OS Command
Ubuntu apt-get install libmysqlclient-dev
FreeBSD pkg install mysql56-client

Compilation

After uncompressing an archive go to dDNS-ng/src directory and type make. If you are a FreeBSD user type: gmake.

Installation and configuration

Running server requires few additional steps. First of all we have to prepare a database and than we will be ready to run install.sh script and edit configuration file.

Database preparation

Running dDNS-ng for the first time we have to create new database and database user account with decent privileges to tablespace. This can be done with these steps

mysql> CREATE DATABASE dyndns;
mysql> GRANT ALL ON dyndns.* to 'dyndns_user'@'%' IDENTIFIED by 'someRandomPassword';
mysql> FLUSH PRIVILEGES;

Once you allready have new database and database user associated with it you are in position to run **install.sh** script. Go to dDNS-ng/src directory and run a command:
```bash # ./install.sh server ```
This is an interactive script, so follow the instructions appearing on the screen. In result you will have server (or client) program and associated configuration file copied in proper place. Installation script will also ask you to provide data for initial admin account. These information will be stored in newly created database.

Configuration file

Server (and client) cofiguration file comes with few defaults which you can change if you want. All of the options are summarized below

Option Default Description
zones none absolute path to bind directory where zonefiles are stored. IMPORTANT NOTE!: path have to end with trailing /
listen_on 12345 TCP port on which server will wait for connections. Please make exception in firewall rules if necessary.
log none absolute path to logfile
pid /var/run/ddns-server.pid pidfile location
db_host localhost your MySQL server address. Leave it unchanged if you run it on the same machine like ddns-server
db_name database Database name
db_user user Database user account
db_secret password Database user's password.
smtp_ip 127.0.0.1 SMTP server IP Address. Leave it unchanged if you run it on the same machine like ddns-server
smtp_port 25 SMTP server port. Leave it unchanged if it runs on standard 25/tcp port
mail_from dyndns@example.com email address which will be set as sender address (From). It can be alias to your existing account

Running a server

Tu run installed and configured dDNS server switch to root account and run:

# ddns-server -c /etc/dyndns-server.conf

Program will run in background. If you want to keep dDNS server running after system reboot add it to /etc/rc.local file with full path to the executable.

/usr/bin/ddns-server -c /etc/dyndns-server.conf
Clone this wiki locally