
|
View Full Version : Redirecting a domain when the server is down, possible?
build-a-host 08-10-2008, 03:43 PM Hello all,
One of the servers I use has been having some really shakey uptime over the last couple of days. I was wondering if there is anyway that I can do this>
I want to set it up so that when the main server (A) is down, my main domainname.com will redirect to server B. Then, when the server comes back up, it directs back to server A.
Is that possible? If so, how do I set that up?
It seems like it would be a simple change of the nameservers, and adding the website files to a domain on server B but, I'm not sure and don't want to mess with it and have more downtime, for nothing.
Thanks in advance!
Aorozco 08-10-2008, 11:27 PM Sounds as a Typycal round robbin problem. If you use Email or database the things change, but, if is a static site, or no database are changed, you only need provide 2 dns for each server, then you can have the same site in 6 servers without much problem, but email and db need a inteligent approach and you dont give enough data to know the actual situation.
By the way, for THAT description, i suggest you to changer providers ASAP.
citricsquid 08-10-2008, 11:37 PM Is this not the point of nameservers? You have NS1 and NS2 resolving to server A and when server A doesn't resolve, IE, is offline, the domain resolves to NS3 and NS4, so you set them to server B.
I think that's right anyway...
build-a-host 08-11-2008, 05:39 AM Is this not the point of nameservers? You have NS1 and NS2 resolving to server A and when server A doesn't resolve, IE, is offline, the domain resolves to NS3 and NS4, so you set them to server B.
I think that's right anyway...
Thats what I was thinking, I'll try that and see what happens.
Thanks
You can't count that the domain always first resolves to ns1, then ns2, ...
There is no order in resolving, it's random.
You also can have per ns up to 13 IP's.
pritesh 08-12-2008, 04:09 AM Hello all,
I want to set it up so that when the main server (A) is down, my main domainname.com will redirect to server B. Then, when the server comes back up, it directs back to server A.
Are you looking to have server A as your primary server and redirect to server B ONLY IF server A is down?
If yes, then having nameservers of different servers wont really help.
Will try to explain in detail :-
Suppose you have a domain name with nameservers as ns1.namesever.com and ns2.nameserver.com. NS1 points to server A and NS2 points to server B.
Now, the queries actually reach the nameservers in a round robin fashion. This is only for load balancing.
So, if your query reaches NS1, and NS1 is offline, your 'A' record will not be fetched and the site will be inaccessible. It will never check if the server is online or not.
Inversely, if both the servers are online, all the queries will be shared by both NS. (server A and server B).
To achieve this, the best way is to have each nameserver point to multiple IPs of multiple servers. How does this help? In any DNS query, the ultimate goal is to find the final address record.
Eg : NS1 - points to 1.1.1.1 and 2.2.2.2
NS2 - points to 1.1.1.1 and 2.2.2.2
Here 1.1.1.1 and 2.2.2.2 are the ips of different servers.
So, if your query reaches NS1, and if 1.1.1.1 is offline, then it will go to 2.2.2.2.
Disclaimer :Al domain names and IPs in this post have been used for example purposes only.
This is my understanding of DNS and I think this is what you are looking for. If I am missing something, please let me know
<<Signature to be set up in your profile>>
build-a-host 08-12-2008, 02:55 PM Thanks, I thought the nameserver change sounded a bit too simple.
BuffaloBill 08-12-2008, 03:09 PM Is this not the point of nameservers? You have NS1 and NS2 resolving to server A and when server A doesn't resolve, IE, is offline, the domain resolves to NS3 and NS4, so you set them to server B.
I think that's right anyway...
This will not work at all.... Name servers are tried in round robin order.... So NS3 has just as good of a chance as being used the first time as NS1 or NS2 or NS4.
Your cheapest solution is to use a service like DNS Failover with DNS Made Easy (www.dnsmadeeasy.com).
http://www.dnsmadeeasy.com/s0306/movies/dns_failover.htm
plumsauce 08-12-2008, 05:06 PM In addition to the point made by BuffaloBill, you definitely need to be using a third party provider in order for the NS to remain reachable during these incidents. You will also need low TTL values, and you will need to accept that the failover mostly works. Not every dns cache is going to honor the low TTL values.
But, yes, it will work fairly well.
Domainitor 08-13-2008, 12:04 AM Are you looking to have server A as your primary server and redirect to server B ONLY IF server A is down?
If yes, then having nameservers of different servers wont really help.
Will try to explain in detail :-
Suppose you have a domain name with nameservers as ns1.namesever.com and ns2.nameserver.com. NS1 points to server A and NS2 points to server B.
Now, the queries actually reach the nameservers in a round robin fashion. This is only for load balancing.
So, if your query reaches NS1, and NS1 is offline, your 'A' record will not be fetched and the site will be inaccessible. It will never check if the server is online or not.
Inversely, if both the servers are online, all the queries will be shared by both NS. (server A and server B).
To achieve this, the best way is to have each nameserver point to multiple IPs of multiple servers. How does this help? In any DNS query, the ultimate goal is to find the final address record.
Eg : NS1 - points to 1.1.1.1 and 2.2.2.2
NS2 - points to 1.1.1.1 and 2.2.2.2
Here 1.1.1.1 and 2.2.2.2 are the ips of different servers.
So, if your query reaches NS1, and if 1.1.1.1 is offline, then it will go to 2.2.2.2.
As has been stated before, name service operates in a round-robin fashion. This includes, however, all resources. If you configure your name servers such that you have two A records for your web server -- one being the 'live' server and one being the 'backup' server -- what'll happen is that roughly half of your requests will go to the live server and the rest to the backup server. If it's okay that you get requests to the backup server while the live server is functional, then, of course, this approach is fine.
If, on the other hand, you want traffic to your backup server only when the live server is down, you'll need to keep your TTLs low (which will jack up your DNS queries) and you'll need to monitor the live site and change the A records whenever you detect that it's off-line. You'll lose some of the visitors while the name server caches expire the 'old' address records, but then your traffic will start going to the backup server. Clearly, the monitoring should be automated with automated name server updates....
othellotech 08-13-2008, 01:22 AM In addition to the point made by BuffaloBill, you definitely need to be using a third party provider in order for the NS to remain reachable during these incidents. You will also need low TTL values, and you will need to accept that the failover mostly works
IME it works less than 20% of the time as most ISPs ignore TTL and many cache the IP for upto a week !
BuffaloBill 08-13-2008, 12:59 PM IME it works less than 20% of the time as most ISPs ignore TTL and many cache the IP for upto a week !
Are you serious?! That would be aweful if they started to do this as I'm relying on this for a long time and have not had problems at this point.
When you mean "most" ISPs who are you referring to? Is this regional to you?
Please give a list of "most" of these ISPs that you think ignore TTLs that are 5 minutes. I have been relying on solutions like this for years for my customers and so far none of them have had any problems.
othellotech 08-13-2008, 02:24 PM When you mean "most" ISPs who are you referring to? Is this regional to you?
Most as in most as in almost all as in many as in ...
- particularly "consumer" oriented ISPs AOL, Tiscali, Demo, Virgin/NTL, etc
i.e. all those in a "race" to offer the fastest speeds, fattest pipes at virtually no money, and then only actually provinding the sh!test "service" with as many costs and corners cut as possible
- I *doubt* it's "regional" unless regionel = UK, US, NL and other countreis :p
I have seen various ignore and cache results for days. Do *not* rely on TTL as
ISPs will ignore it
O/S can ignore it
Browsers can ignore it
Home routers/firewalls ignore it etc etc
- if you are assuming R-R-DNS will keep you online or act as some sort of load-balancer you have ben sadly mistaken for a number of years.
BuffaloBill 08-14-2008, 12:32 AM - particularly "consumer" oriented ISPs AOL, Tiscali, Demo, Virgin/NTL, etc
That's funny you say that. We actually have accounts that have access to the resolvers of AOL and Tiscali and both of them do not ignore low TTLs (180 seconds actually).
The Tiscali we are using is out of UK and the AOL is based all of the United States.
So this must be something regional to you. Can you send me a dig / nslookup to one of those resolvers that comes back with a TTL that is not correct from AOL? We actually can bring this up to one of the admins that works at AOL if you do (since we had a ticket about this in the past to make sure they did not overwrite the TTL).
O/S can ignore it
Browsers can ignore it
Home routers/firewalls ignore it etc etc
Yes, all of them "can". But most I would say most do not unless you hack these up to do so. Especially home routers / firewalls.... There is not one on the market that will ignore TTLs.
By default even Microsoft does not ignore the TTL.
All browsers do to a point. But where DNS Failover is most useful for is for the users that have NOT been to the website yet (before it went down). If you are on the website when it goes down then yes, you will have some time that it will not resolve.
JenLepp 08-14-2008, 01:31 AM https://www.dnsmadeeasy.com/s0306/prod/dnsfosm.html
DNS Failover Service from DNS Made Easy.
plumsauce 08-14-2008, 02:00 AM IME it works less than 20% of the time as most ISPs ignore TTL and many cache the IP for upto a week !
I have seen various ignore and cache results for days. Do *not* rely on TTL as
ISPs will ignore it
O/S can ignore it
Browsers can ignore it
Home routers/firewalls ignore it etc etc
- if you are assuming R-R-DNS will keep you online or act as some sort of load-balancer you have ben sadly mistaken for a number of years.
My original message already contained an appropriate caveat.
However, in my experience, it is not as dire as you make it out to be.
Let's go through your list again,
"ISP's will ignore it " - some, but not enough to take you completely offline.
"O/S can ignore it" - not any modern consumer O/S worth mentioning
"Browsers can ignore it" - not the mainstream browsers
"Home routers/firewalls" - um, maybe, there are too many out there to be able to make a blanket statement.
The bottom line is that specialised dns is the *only* approach that will keep you online in an automatic failover scenario short of akamizing your site, or *trying* to do tcp anycast. Even the most expensive hardware options rely on it under the covers. No matter what marketing mumbo-jumbo they speak.
It is better to be *mostly* available than not available at all.
As it stands now, there is *no* guarantee that an available server can be reached from *every* isp connection at *every* moment.
If someone has had a particularly bad experience with caching, it can often be traced down to incorrect record setup with mismatches all over the place. In other words, the records are confusing the cache and the cache punts.
It's like a hammer, it can do a really fine job of driving in nails, or you can have a smashed thumb. Gotta swing it just right :)
|