How can i make load balancing with BIND 9?

Discussion in 'Server Operation' started by xdanx, Nov 9, 2008.

  1. xdanx

    xdanx New Member

    I'm having a frustrating issue here, and i cant find a viable solution after searched howtos for a month...

    My setup is as follows : i have 2 server, with 2 different public IP addresses. I'm running BIND on both of them, and i did setup them according the as follows: 1 slave and 1 master.
    I dont want to make load balancing between them, and also i want to make a "failover" situation. I dont know if this is the corret term. Basicly, if one server is down [ having no internet connection] i want to redirect all users who access my website to the other server who is already mirroring the content. And i want to do this with BIND, because i dont have the resources to use a hearthbeat server.
    I found that i can use SRV options, to make a load balancing and a failover situation. and my setup looks like this : [ the domain and ips are changed ]
    [the SOA thing ]..
    $TTL 28800
    @ IN NS
    @ IN NS      A
    ns1             A
    ns2             A
    $TTL 84        IN SRV 0 1 80
                                       IN SRV 1 1 80          IN A         IN A
    The problem is if i stop apache / bind on, and i flush dns records on my computer, when i try to access i get Connection timed out , but no redirection.

    Knowing this, can you give me any ideea, or a link to a resource i can consult ? Everywhere i go, it says the same thing : use SRV records and it works 100%. But in my case, it doesn't.

    Also, I am interested in any possibility to do what i want to do. I can modify the nameservers pointing to my servers in the Root NS.

    Thx a lot for reading,
  2. falko

    falko Super Moderator ISPConfig Developer

    DNS is a bad solution for HA setups because DNS records are almost always cached, so you can never be sure what answer a client gets for a DNS query (even if it's working for you).
  3. xdanx

    xdanx New Member

    But what if i set the TTL for let's say 60s? I made a research on google NSs, they have set TTL for 84s, and they are using round robin DNS, with 4 ips.
    And speaking of this, isn't round robin a form a load balancing ? I'd use that method if it wasn't 1 problem : the round robin thingy cannot control whether the server is "dead" or online..
    Supposing we don't get cached, is there any method i can make what i want ?

  4. falko

    falko Super Moderator ISPConfig Developer

    That doesn't help you if other name servers don't care about the TTL and use a caching mechanism. There are lots of caching nameservers out there.
  5. xdanx

    xdanx New Member

    Ok then. Thx a lot for your help. I think i'll just try to find another solution.

Share This Page