linux poison RSS
linux poison Email

MyDNS + MyDNSConfig installation and configuration

MyDNS is a free DNS server for UNIX. It was implemented from scratch and is designed to serve records directly from an SQL database (currently either MySQL or PostgreSQL).

Its primary objectives are stability, security, interoperability, and speed, though not necessarily in that order. MyDNS does not include recursive name service, nor a resolver library. It is primarily designed for organizations with many zones and/or resource records who desire the ability to perform real-time dynamic updates on their DNS data via MySQL.

MyDNS starts and is ready to answer questions immediately, no matter how much DNS data you have in the database. It supports a few frills, including round robin DNS, dynamic load balancing, and outgoing AXFR for non-MyDNS nameservers and is licensed under the GNU General Public License.

First make sure you have a working setup of Apache and mysql

Download MyDNSConfig:
# wget
# tar xvfz MyDNSConfig-1.1.0.tar.gz
# cd MyDNSConfig-1.1.0
# mkdir /srv/www/htdocs/mydnsconfig
# cp -rf interface/* /srv/www/htdocs/mydnsconfig

Above "/srv/www/htdocs/" is my web directory

Mysql database setup::
# mysql -u root -p

> GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost' IDENTIFIED BY 'mydnspassword';
> GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost.localdomain' IDENTIFIED BY 'mydnspassword';
> quit;

Replace the word mydnspassword in the above commands with a password of your choice.

Install the MyDNSConfig MySQL Database:

# mysql -u root -p mydns < MyDNSConfig-1.1.0/install/mydnsconfig.sql

Edit the MyDNSConfig configuration; please make sure you fill in the correct database settings:
# vi /srv/www/htdocs/mydnsconfig/lib/

$conf["db_type"]        = 'mysql';
$conf["db_host"]        = 'localhost';
$conf["db_database"]        = 'mydns';
$conf["db_user"]        = 'mydns';
$conf["db_password"]        = 'mydnspassword';

Installing MyDNS
# wget
# rpm -ivh mydns-mysql-1.1.0-1.i386.rpm

Open the MyDNS configuration file /etc/mydns.conf, fill in the correct database details, allow zone transfers by setting allow-axfr to yes, enable TCP (allow-tcp = yes), and specify a recursive resolver (i.e., a valid nameserver, e.g. from your ISP; e.g. recursive = so that MyDNS can answer queries for domains that it isn't authoritative for:

# vi /etc/mydns.conf

Finally start the mydns server
# /etc/init.d/mydns start

To log in to the MyDNSConfig interface, open a web browser and enter enter the following URL:


Replace with the IP address of your server.

The default username and password of MyDNSConfig are:

Username: admin
Password: admin


Post a Comment

Related Posts with Thumbnails