[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Round robin DNS type of service



Roberto C. Sanchez wrote:

>> I want to purchase ANOTHER dedicated server and make it so that if on
>> someone types in the browser www.eccotours.biz, obviously it will
>> resolve to
>> one of the IPs. BUT how will I handle if one of the machines is down.
>> How can I get around this.
>> Or will the client first try one IP, if on failure, try the next one.
> What you want to do requires a front-end machine for load balancing, not
> an additional IP/DNS setup.  You would tell it to proxy traffic to one
> of two (or more) machines that are up and running.

Well - it can actually be done with a little bit of clever DNS setup too
and to the best of my knowledge completely acceptable from a DNS point of
view.

Imagine we want to configure 3 identical web servers and do a reasonable
load balancing between them - AND make sure one of two of them can be
down without too many users being annoyed.  Let's use company.com as an
example domain.

We want to play with some NS records instead of A or CNAME records, so in
the basic company.com zone we do two things - redelecate a sub domain AND
do an alias - something along this line:

web             IN      NS      server1
web             IN      NS      server2
web             IN      NS      server3

server1         IN      A       xxx.xxx.xxx.xxx
server2         IN      A       xxx.xxx.xxx.xxx
server3         IN      A       xxx.xxx.xxx.xxx

www             IN      CNAME   www.web

Ok - by now we have appointed our three servers as authoritative for the
web.company.com domain and we point www to a server called
www.web.company.com.  Normally when configuring 3 name servers for a
domain you would make a master and then slave the other two.  In this
case we do NOT do that - we make all three authoritative AND we make sure
it's got a VERY short time to live (say 5 minutes).  These zones will
follow something like this:

Server 1:
---------
www             IN      CNAME   server1.company.com.

Server 2:
---------
www             IN      CNAME   server2.company.com.

Server 3:
---------
www             IN      CNAME   server3.company.com.

In other words what server we resolve to depends on which name server we
asked and if one of the name servers disappear - nobody will ever point
to that particular server.

GRANTED - this is not bulllet proof.  It does NOT protect against for
example apache dying while bind is still running (but honestly - how
often does that happen compared to an internet line being down?).  Also -
when a server or connection dies there WILL be a short period where users
are pointed to the dead server.  It does however provide a reasonable
load balancing AND contrary to having a proper proxy it can  be
distributed across multiple internet or hosting providers.

-- 
Lars



Reply to: