Comments on Running A MySQL-Based DNS Server: MyDNS

Running A MySQL-Based DNS Server: MyDNS In this tutorial I will describe how to install and configure MyDNS, a DNS server that uses a MySQL database as backend instead of configuration files like, for example, Bind or djbdns. This has the advantage that you can easily use web-based frontends to administrate your DNS records. You could even write your own frontend, e.g. using PHP, to interact with the MyDNS database. MyDNS simply reads the records from the database, and it does not have to be restarted/reloaded when DNS records change or zones are created/edited/deleted! This is a major advantage.

7 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anonymous

Article states:

MyDNS simply reads the records from the database, an

t does not have to be restarted/reloaded

when DNS records change or zones are created/edited/deleted! This is a major advantage.

Only old BIND deployments would run this way. BIND has supported dynamic updates for quite some time. Mine never goes down (well practically speaking). All of our changes to the BIND DATABASE are made dynamically.

I emphasize database, because BIND is a database... whether you want to look at that way or not. I'm not against a DNS sitting on top of a database of some other kind, but I certainly don't like tools where the data is replicated out of a sql database and into BIND... just speaking out loud. Again, serving up out of a sql database is fine... just want to point out that BIND has/is a database and you don't have to restart it to make record changes or additions (with a few exceptions.. but not 99% of what would be changed normally).

By: Azuretek

Just wanted to clarify, you do have to reload the bind configuration for record changes to take effect. The benefit of running MyDNS is that you can replicate changes and backup your data the same way you would do it for any other database driven application.

Reloading bind is usually accomplished by using "rndc" which is kind of like an API connector that can be used to control bind. Issuing the command "rndc reload" will apply your record updates.

By:

The occurs from an incompatability with PHP5. Easily resolved with either:

vi +2475 /var/www/admin.php *hit enter

*this will open admin.php at line 2475, now you need to edit each instance of $this to $_this

between line 2475 and 2485 

if you arn't familiar with vi, you may find it easier to use nano (please note that ^ represents the CTRL key on your keyboard, I am using it here as it is what you will see in the editor)

nano /var/www/admin.php *hit enter

^\ *hit enter

Search (to replace): $this *hit enter

Replace with: $_this *hit enter

Replace this instance?: A *hit enter

^x *hit enter 

Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ?  Y *hit enter

File Name to Write: /var/www/admin.php *hit enter 

That's it, in the end that section should look like the following:


/**************************************************************************************************
   RR_TYPE_OPTIONS
   Returns a list of resource record types.
**************************************************************************************************/
function _rr_type_option($type, $_this) {
    return "<OPTION" . (!strcasecmp($type, $_this) ? " selected" : "") . ">$_this";
}
function rr_type_options($type)
{
   global $db_valid_types;

   reset($db_valid_types);
   $rv = '';
   foreach ($db_valid_types as $_this)
      $rv .= _rr_type_option($type, $_this);
   return $rv;
}
/*--- rr_type_options() -------------------------------------------------------------------------*/

 

By: Anonymous

I would love to see how this could be used in conjuction with an existing server setup so that it would be a secondary only to what is already being used on that server. 

For example I have a VPS that I rent and I would like to be able to use MyDNS as a secondary resource so that current setup of LXAdmin would not be affected but I could still use this for certain domains or subdomains that I would like to be able to work as my own dynamic dns service on my own server.

By: Anonymous

It goes to show how bad BIND's config file management really is--that--someone would write, from scratch, a DNS server using mysql to manage the records. Amazing.

By: sysAdmin

I've Found a great DNS scanner that can locate any DNS server at your network (multi-subnet) it can also test if the DNS is answering anyones requests or not.
you can get it here: http://www.softpedia.com/get/Internet/Other-Internet-Related/DNS-Locator.shtml

By: Diaz

Hello Falko, I got it: No supported database found.  Either MySQL or PostgreSQL is required. What MySQL version are you using?