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 ISPConfig Developer ISPConfig Developer

    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 Active Member

    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).

Share This Page