Web Hosting Talk







View Full Version : Nameservers question


MattMans
08-20-2002, 06:16 AM
Hi all

I'm thinking of a way to create a backup page for one of my sites incase the server goes down (doesn't happen often, but frustraiting nevertheless when it does).

I want to setup a page on another host with some text along the lines of "There's a tech problem blah blah...".

The domain name has nameservers 1 and 2 set to my main host. If I were to set 3 and 4 to my other host would 3 and 4 take over if 1 and 2 went down?

It's important that 3 and 4 would only come into play if 1 and 2 went down because otherwise some people could be directed to the "problem" page when the main site is actually up.

Other ideas to produce the same end result would also be welcomed!

Cheers

Matt

MotleyFool
08-20-2002, 06:50 AM
Matt

Set up a round robin DNS.

It is vital that all your nameservers have the same DNS data - or else you will have unpleasant site viewing experiences.

What you can do is,

have ns1 on your main server and ns2 on your second server

In your zone records

put the first A record for your domain as IP.1.server and then next line
put A record as IP.2nd.server

This way the DNs will send requests to the first server and if it is down send users to the second server

MattMans
08-20-2002, 06:58 AM
Thanks MotleyFool

But I'm not 100% clear on what I should put into my zone files.

Can I have 2 A records for the same host?

e.g:

www A 111.111.111.111
www A 222.222.222.222

I'd put this in the zone file on each host, right?

Cheers

Matt

MotleyFool
08-20-2002, 07:13 AM
yes identical zone records..

the first IP will be routed first and if it fails the second will be routed to.

Please let me know if it doesn't work

:beer:

:D
Balaji

MattMans
08-20-2002, 07:15 AM
Thanks MotleyFool

I'll try it when I get home tonight.

I didn't know you could have more than one entry for a the same hostname in a zone file ;)

Matt

MattMans
08-20-2002, 11:52 AM
I've just been looking around the net for more information on MotleyFool's suggestion and people are saying that some visitors may be sent off to the "problem" page, even when the main site is up. So the hosts in the zone files wouldn't necessarily be read in order.

I also just found out my "backup" host won't let me have more than one IP per hostname :mad: (since the DNS can only be controlled via a web interface). They might sort it though if it's a bug and not intentional.

Can anyone confirm or deny the points above about the order hosts are read from the zone file?

Again, other suggestions to the original query would be welcomed!

Cheers

Matt

achost_ca
08-20-2002, 03:03 PM
From my understanding its is more roundrobin, where the first visitors gets the top one, and then the next will most likely get the next, so yes, your visitors may end up at the 'problem' page while the site is functioning. Im gonna go track down my bind books, and just double check this. if i recall, there is an entire chapter devoted to this issue.

achost_ca
08-20-2002, 03:12 PM
just double checked, its example is as follows (from o'reilly dns and bind, 3rd edition)

foo.bar.baz. 60 IN A 192.168.0.1
foo.bar.baz. 60 IN A 192.168.0.2
foo.bar.baz. 60 IN A 192.168.0.3

the server will hand the first record out, then to the next visitor the second, and the next the third, and restart over, it isnt true load balancing, more of just load sharing. so that wont work for your situation

there is an alternate version of bind somewhere i remember seeing that natively can handle load balancing, might be an idea to check into that.

MotleyFool
08-20-2002, 07:44 PM
Thanks Jason..

My bad then! :(

bitserve
08-20-2002, 08:58 PM
This has been asked a lot of times before.

You might do a search in this forum for a lot of additional information.