View Full Version : How to redirect my visitor to my second website???
sg552
April 26th, 2008, 16:26
Hi, I have a question, really sorry if post at the wrong place:P
I have a website host on server A in Florida and my second server B in Chicago. Both server A and B has the same content. My question is, let's say server A is down, how can I redirect my visitor to server B...:confused4
hread
Is this have something to do with the nameserver in my domain setting... :confused4
For example:
ns1.A.com
ns2.A.com
ns3.B.com
ns4.B.com
Once again I'm really sorry if I post i the wrong thread. Please enlighten me on this one & thanks in advance:wave:
SC-Daniel
April 26th, 2008, 17:11
Simply changing the nameservers to the pattern that you mentioned would not do what you are needing to do.
Even though NS1 may be listed first, often times they will just query another nameserver instead. It's really just one of those things with the internet that could be improved ;)
What you actually need is a failover DNS solution similar to that of ZoneEdit. I actually used ZoneEdit's failover DNS on one of my domains in the past and the only reason I stopped using this setup was because there was no longer a need for it.
Basically what ZoneEdit does is query a certain file, which you specify, and it looks for a certain phrase in that file in the first line. If that phrase is missing then it marks the site as down and queries the second site doing the same test. If the second site is determined to be live then the DNS records are quickly changed and the backup site will become live.
The interval between queries is something like 10 minutes, so this solution still would not offer 100% uptime. The queries are done from several nodes and if so many of them report a site down then it fails over.
Now that is the "poor mans" way to failover. The true way would be very costly and is most likely not needed.
jakeruston
May 3rd, 2008, 16:27
You could do that, or maybe a simple Redirect in the .htaccess would be sufficient.
SC-Daniel
May 3rd, 2008, 16:29
You could do that, or maybe a simple Redirect in the .htaccess would be sufficient.
Incorrect, that would not work.
The OP wanted to redirect ONLY if Site A is unaccessible because the server is down. How would an htaccess redirect solve that problem? It wouldn't because that would ALWAYS redirect to Site B and would also require server A to remain online 100% of the time.
themoose
May 3rd, 2008, 17:25
Does anybody know what this is?
http://i27.tinypic.com/1zpk7ea.png
Note how they're all set to ns1.*..
Dynash
May 3rd, 2008, 18:16
Does anybody know what this is?
http://i27.tinypic.com/1zpk7ea.png
Note how they're all set to ns1.*..
you can have them all the same prefix, just as long as they are different IPs?
sg552
May 3rd, 2008, 23:27
Thanks for your answer. My theory actually do work:P 4 days ago my website at server A (ns1 and ns2) is down but I still can access my website. Why? because my domain automatically redirect me to server B (ns3 and ns4). I check my domain IP and it point me to server B IP and nameserver:fangel:
Thank you
Simply changing the nameservers to the pattern that you mentioned would not do what you are needing to do.
Even though NS1 may be listed first, often times they will just query another nameserver instead. It's really just one of those things with the internet that could be improved ;)
What you actually need is a failover DNS solution similar to that of ZoneEdit. I actually used ZoneEdit's failover DNS on one of my domains in the past and the only reason I stopped using this setup was because there was no longer a need for it.
Basically what ZoneEdit does is query a certain file, which you specify, and it looks for a certain phrase in that file in the first line. If that phrase is missing then it marks the site as down and queries the second site doing the same test. If the second site is determined to be live then the DNS records are quickly changed and the backup site will become live.
The interval between queries is something like 10 minutes, so this solution still would not offer 100% uptime. The queries are done from several nodes and if so many of them report a site down then it fails over.
Now that is the "poor mans" way to failover. The true way would be very costly and is most likely not needed.
SC-Daniel
May 3rd, 2008, 23:29
That is odd... Technically that shouldn't work and should cause problems with mail and everything.
Anyway, glad you found a solution.
EDIT:
I just did a quick google search and the approach you are using is sometimes used for load balancing. If you watch your site closely, you will notice that sometimes you will go to site A and somtimes site B even if Site A is still online. This is just the way DNS works.
Now, I would think that if Site A was offline, some users will still get a server not found error due to either caching or querying the wrong nameservers.
Decker
May 4th, 2008, 05:07
Does anybody know what this is?
http://i27.tinypic.com/1zpk7ea.png
Note how they're all set to ns1.*..
As long as the DNS entries are kept syncronised on all ns1 entries it will work, it will just be random (more or less) as to which one is referenced.
It's a bit pointless though :)
david432111
May 4th, 2008, 11:40
Though you could try making the nameservers for server 2 ns3.-------.com and ns4.--------.com
YourData1st
May 6th, 2008, 15:13
I like the load balancing idea even though this isn't my scenario. As long as they are mirrored correctly then you will always be good to go. Use some software to monitor them, or a site like siteuptime would be a major +. Again thats just how I would go about it.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.