MyDNS (Master) -> Bind (Slave) Support

Discussion in 'General' started by todgerme, Sep 1, 2007.

  1. todgerme

    todgerme Member

    Not content with running a second MyDNS slave through MySQL replication I set about getting xfers working with Bind. Not too difficult but I wanted a way so that if a new domain is added to MyDNS, the named.conf was updated with the new zones or indeed removed. So far I have created an add domain frontend that adds a new record in MyDNS and goes through a standard templete. From there it updates a date with the following structure:

    NS0 | NS1 | NS2

    On this example there is 3 Bind slaves. I have written a script in Perl that runs every 5 minutes a checks this additional table created and regrabs all the zones and writes the config when an update is required but I was wondering if we could possibly build in support for this in MyDNS and bundle the Perl script with MyDNSconfig for users who want to run Bind as slaves to a MyDNS master. It would be as simply as add new domain or remove old domain changes these table values for the Perl script to come along and redo the configs and perform an "rndc reload" on the slave but I thought it was worth asking.

    What does anyone think?
  2. falko

    falko Super Moderator ISPConfig Developer

    I think you can simply allow zone transfers in the MyDNS configuration file and then let BIND fetch the zones from the MyDNS master.
  3. todgerme

    todgerme Member

    No you're misunderstanding me - this is for when a NEW domain is added to get the new configs created for Bind to know to ask the master for the zones.

    Otherwise it's not what I would call the perfect solution - requiring you to go to the slaves and add additional lines into the named.conf.

    Basically my script looks at the mysql db that mydns uses and regenerates the configs if "Update" is required for that particular nameserver - this is purely for when a new domain is added/removed using mydnsconfig. ofcourse the xfers stuff takes care of changes to the zones but without the extra glue the whole thing requires manual intervention and I wonder if we could offer a Mydnsconfig option with extra bind support along with my perl script.
  4. falko

    falko Super Moderator ISPConfig Developer

    You always have to create the slave zone in BIND. OTherwise BIND wouldn't know which zones to fetch from the master. It wouldn't even know the master.
  5. todgerme

    todgerme Member

    Yes I know but I have created a Perl script that looks at the Mysql in mydns and creates the configs but I need a way to tie it into mydnsconfig and wondered if we couldn't help produce a version that works with mydns and bind slaves.

    Basically I have a database table called "dns_slaves", then I have 3 columns for ns0, ns1, ns2

    The values allowed are update or updated.

    The Perl script looks at this table and if NS0 has a value of update, the Perl script does a select of the active domains and writes the configs and reloads bind. The script then changes this value for NS0 from update to updated. Xfers then takes of the rest.

    What I wanted to get opinion was, if a domain was added/removed via mydnsconfig it would automatically update the dns_slaves table and allow the entire platform to be glued together for people who want to run mydns master with bind slaves.

    Hopefully this all makes sense at this point. So basically we will have that perfect solution as I mentioned that works from one frontend.

    Let me know or perhaps you can point me in the right direction of the files in mydnsconfig that I need to modify. I can then release it on the mydnsconfig site as a patch to help with bind slaves. It would be a shame not to share.

Share This Page