“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. 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! I will also show how to set up a secondary DNS server, but I will not use normal zone transfers to get the records from the primary to the secondary DNS server; instead, I will use MySQL database replication. I will simply replicate the data from the primary to the secondary server.”
Running a MySQL-Based DNS Server: MyDNS
About The Author
Follow me on Twitter @thomholwerda
2006-01-22 7:57 pmchrisbell
Strangely enough, MyDNS also supports Postgres quite well; I’ve been using it in production for a year now.
DNS is one of those very critical services.
This sounds like *great* idea but I wouldn’t be surprised to see (insert yet ANOTHER php vulnerability or insecure script written by a novice programmer) problems with implementations or administrative tools. Oh look, there was another flaw in phpmyadmin and now your dns server is owned… bummer.
I’ll stick to dbjdns on OpenBSD for my DNS servers and linux for everything else although the “no zone axfr” via mysql replication is pretty cool.
It is great idea to store DNS in SQL. But
-If you have only couples of DNS records you dont need to store them in SQL database
-If you have more DNS records like me (about 1000 zones) then it is better to make simple script that will convert the SQL data to BIND configuration.
Because if you have separate mySQL server then crash of DNS server will cause “crash” of your DNS system.
I was using it, I was happy about 6 months, then I realized that BIND is easy to configure than myDNS and you dont have so many POINTS of FAILURE.
because you don`t need WEB server, Mail server, and secondary DNS server if yours SQL server is DOWN
Now if my SQL crashes, my WEB, mail, and DNS servers will run. so only couple of sites will stop working.
mySQL is great product, but for real world.
2006-01-22 2:50 pmsyphon
Sorry for all therse errors I dont can`t edit the post.
The final sentence should be:
myDNS is great product but not so GREAT for real world.
I also wanted to notice that I have about 10% less mySQL usage when I use bind instead of myDNS.
I have all zones stored in myDNS compatible SQL database so I can switch betwen myDNS and BIND..
2006-01-22 8:03 pmchrisbell
Yes, but bind is very slow when compared to bind-dlz… and bind-dlz (even non-dynamic bdb) is slow compared to MyDNS. I am able to do 20k queries a second with MyDNS (postgres backend).
On the other hand, I can understand why someone would want to run bind for the sake of reliability.. but there is a sacrifice!
2006-01-22 10:24 pmsyphon
Yes, that is all true, but realize that if you lost your mySQL server for couple of hours for some reason, it is quite possible that you DNS system (servers) is sgoing down with it. What good is mail server and web server when there are no DNS server resolving MX and A records
So I think it is easyer to setup secondary BIND server like setup secondary myDNS + mySQL server independent on that first and master mySQL and myDNS server… that has also exact the ZONES like the first server. in this case you need to run TWO mySQL servers and synchronize them
As I said myDNS is GREEAT, but I only talking about my 6 months experience with myDNS in mission critical applications
It`s only my point of view anyway myDNS is GREAT software! it was very usefull for me when I migrated from Windows 2000 to BSD servers…
2006-01-23 7:42 amrajj
Using a relational database to store non-relational data is absurd.
A casual glance of their database schema shows two tables for soa records and for rr records. Neither of them reference the other.
It’s also possible to use a MySQL backend with PowerDNS, afaik.
PowerDNS is a DNS server that can use a Postgres database as backend iirc