How can I setup DNS in my master-master replication of ISPConfig?

Discussion in 'Installation/Configuration' started by voltron81, Nov 2, 2009.

  1. voltron81

    voltron81 New Member

    Hello to everybody,
    as maybe you remember, I've setup 2 mailserver with a master-master replication of mysql and /var/vmail (with glusterfs).

    Now that the configuration is finished, I've to setup the DNS.
    The idea is: from the webpage of my ISP, I'll setup the DNS with 2 priorities, the first one for the master server, the second one for the backup server, so that if the master server is down, the backup server will be the master one.

    What I have to setup in ISPConfig to finish this configuration?

  2. voltron81

    voltron81 New Member

    I'm completly lost with DNS parameters...:confused:

    This is what I;ve already done:
    On the webpage of my ISP, I've pointed the domain to my 2 servers, as primary and secondary name server. (SRV1 and SRV2)

    Now it's the time of ISPConfig.
    What I want is this: the email must be read ad
    This link must point to SRV1/roundcube and, as second option, to SRV2/roundcube, so that is SRV1 is down, the customers can read the email from the SRV2.
    Of course the priority is a business of my ISP.
    Now, how can I setup ISPConfig to have :
    ON SRV1: -> SRV1/roundcube
    ON SRV2: -> SRV2/roundcube

    Last edited: Nov 2, 2009
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Create two dns A-Records for, one that points to IP of server one and one that points to the IP of server 2. then create a website on every server and install roundcube in it. Every roundcube installation shall connect to the imap server on localhost.
  4. voltron81

    voltron81 New Member

    Thanks a lot Till for your suggestions.

    At the moment I'm having a problem with priority of the domains... my ISP (1&1) look like don't give me the possibility to setup 2 servers for a DNS with prioritities... so now I've the problem how to setup DNS in the way that, when SRV1 is down, the DNS will be connected with SRV2...

    Any idea?

    Thanks again
  5. voltron81

    voltron81 New Member

    Ok I find the way to setup two name servers dor the DNS with 1&1, but now the problem is that there is no priority (randomly the DNS is pointing to SRV1 and SRV2).
    This is a problem because, for example, is I'm reading a webmail to srv1 and after 2 minutes I refresh the page, maybe the DNS will be pointed ti SRV2 and I've to autenthicate again...
  6. voltron81

    voltron81 New Member

    This is the point: once that I've created two dns A-Records for, one that points to IP of server one and one that points to the IP of server 2, I'll have a round-robin DNS, and it's fine.
    The problem is: even if I'll setup a cache limit that decide when DNS will skip from SRV1 to SRV2, what will happen if somebody is reading his email on SRV1 and in that moment DNS will skip to SRV2? The customer will have to logon again...

    Somebody knows a solution for this problem?
    Sorry if I'm posting a lot, but I've almost finish my installation and I would like to complete it to see the final result... ;)

  7. till

    till Super Moderator Staff Member ISPConfig Developer

    DNS will not change in a session as the internet browser does not query dns again.
  8. voltron81

    voltron81 New Member

    Are you sure? Surely it will query again when the TTL has expired? It wont cache it for ever?
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    I recommend that you just try it. Do you expect that your clients keep up sessions open for days or weeks?

    If thats really an issue for you, you might need to install a failover and session aware loadbalancer. Falko has published some howtos on these topics here on howtoforge.
  10. voltron81

    voltron81 New Member

    Thanks I will look into them.

    Not days but at least a few hours (business hours). If I set the TTL to 9 hours though then I could in theory have 9 hours of downtime which is too high.
  11. voltron81

    voltron81 New Member

    Just checked those articles but unfortunately I haven’t got access to any virtual IPs or more then 2 servers
  12. voltron81

    voltron81 New Member

    Ok this is the solution that I've found:
    - I've added in my mysql master-master replication of the mail tables also the part of the database regarding the dns.
    - I've create a bash script that is running on SRV2 and that basically ping the SRV1 and, after 20 ping failed, will update in the dbispconfig:
    "UPDATE dns_rr SET data = 'IP_SRV2' where data = 'IP_SRV3';"
    I've tested it and it's working.

    During this test I've setup this DNS Zone Values:
    Refresh = 60
    Retry = 600
    Expire = 604800
    Minimum = 60
    TTL = 60

    Now it's time to find the right values for this configuration.
    I was reading what does this values means and I found something here:

    Any suggestion?



Share This Page