Proper way to setup primary and secondary DNS (MyDNS or Bind)

Discussion in 'General' started by William K., Sep 27, 2016.

  1. William K.

    William K. New Member

    I wish there is some guide to proper setup primary and secondary DNS.
    1) One single ISPConfig server with 2 IPs: that's easy.
    2) Two standalone servers with ISPConfig, so one should be primary, and the other secondary.
    3) Two ISPConfig servers, with multiserver setup.
    The goal is to input DNS records only in the master, and the second one copy from it.

    There are some posts that you should create an MySQL user to allow servers to connect each other to exchange records, and so on. But, I don't think this is the way a DNS should work. The purpose of second DNS is to keep queries working for a few period until master DNS is in maintenance or restarting, so those hack solutions are like have one server with 2 IPs.

    To get things simple, we can work in a solution between same services, like bind-to-bind and mydns-to-mydns, although I think this should be "transparent" for DNS replication.
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    If you run a multiserver-setup, just define server2 as mirror of server1
  3. William K.

    William K. New Member

    Right, there is this option too. But as far as I know, server2 mirror the whole services, I want to keep some websites/mail in server 1, and use server 2 (and 3, and 4) with other websites/mail servers.

    I think the "ispconfig mirror" is not the same as dns primary/secondary concept. Am I wrong?
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Nope, you are not wrong. The way ispconfig sets up mirrored dns servers is very nice from the perspective you mentioned of the slave running by it self when the master (ispconfig master and/or the other dns server) is down, but you are correct that currently all services are mirrored, so you cannot host different websites/mail on them.

    I sure thought I had filed a rfe to be able to choose a different server to mirror for each service (so server2 can mirror dns of server1, but not web/mail), but I can't find it now. Maybe it didn't survive the migration from the old bug tracker to gitlab. I'll file another if the first can't be found, as there are certainly some good use cases for that.

    As for your scenario, I believe you can just add both servers with web/mail/dns services on both. You put a website/mail where you want it, then for DNS add the zone as primary on server1, and add it as a secondary zone on server2. The copy of dns records will then be performed by bind, with a zone transfer from server1 to server2, rather than how ispconfig mirrored dns servers work (which is records are added in the database on each server and zone files generated locally from those).
  5. Hi there! I'm in William's same situation now. For my mail server I want to set up a secondary server ( in which I want to host web and mail services too (and email routing rules between both servers so they both can act as MX for each other), and bind acting as secondary server for If I tick on being a mirror of will I loose the ability of having web and mail services on server2?

    TIA so much!


    PS. I'm going to make a guess here... If I do not set it up as a mirror, the on the primary I allow zone transfers to the second server's IP, and then I create a secondary zone on the second server, will that work?
    Last edited: Oct 23, 2018
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    yes, that is currently how you would have to set it up.
    Ignacio Garcia likes this.
  7. Thanks so much Jesse!

Share This Page