Jump to content

[Solved] Redirect if server is down


Derek

Recommended Posts

Hey, I have a quick question, I hope someone can help.

 

I'm going to be starting Web Programming classes, and a lot of the homework I'll be needing to pass in will have to be hosted online. I'd rather use this host because it has a lot more "growing room", but if you don't already have a host, you can host your files on the school's server.

 

Let's say I need to pass in an assignment, and Heliohost's server is down. Is there any way I would be able to redirect to a server hosted at my house, or the schools server?

 

I bet I could set up my domain's DNS settings to redirect to a BIND installation on my computer, which would try to connect to the nameservers here, or if failed, redirect to my schools server, but that sounds like a lot of traffic to my house (I technically have unlimited bandwidth, but let's not push it. I'd also not want to run a server on my computer all day while I'm at school in case of this scenario).

 

Thanks.

Link to comment
Share on other sites

The solution you present is the only option and even it has drawbacks. Lots of people think that if the server is down, then the administrators should post a message on all the down sites saying that the server is down but will be back shortly. Problem is, if the server can display that message, then it should just display the users accounts because all the Apache processes (which serve websites) are running. If the server is down, any sort of PHP, htaccess, etc redirection won't work because that will never be sent to the visitor (hence why your website is down).

 

The only true option is to change your DNS. Problem here is, some ISP's like to save money by caching DNS records regardless of what you set the TTL to. TTL stands for Time To Live and is how often your DNS records should be checked for updates (it is common to use something like 1 hour or so). You can certainly shorten this up to something like 1 minute so that as soon as you change your DNS it is changed all over the world. Problem is, this puts a bunch of strain on the ISP's who run DNS servers for their customers. So some ISP's (and I won't name names) like to "cache" these records for longer than they are supposed to. I don't know if your school is affected by this or not.

 

In my opinion, your best bet is to go with the school's server. That way, if there is a problem, lots of your classmates have the same problem and you aren't stuck up a creek without a paddle.

 

But that is just my opinion.

Link to comment
Share on other sites

Problem here is, some ISP's like to save money by caching DNS records regardless of what you set the TTL to. TTL stands for Time To Live and is how often your DNS records should be checked for updates (it is common to use something like 1 hour or so). You can certainly shorten this up to something like 1 minute so that as soon as you change your DNS it is changed all over the world. Problem is, this puts a bunch of strain on the ISP's who run DNS servers for their customers. So some ISP's (and I won't name names) like to "cache" these records for longer than they are supposed to. I don't know if your school is affected by this or not.

 

There is really only two different ISP's you can get where I live. One of them is Verizon, which I don't have, so I can't know what their TTL is, but my ISP I know (with a 95% certainty) that the default TTL is only 10 minutes. But still, I understand what you're saying.

 

It doesn't seem as if I have many choices unless I can find a free DNS host.

 

(Or I could install portable XAMPP on my flashdrive. Knowing me, I'd forget to save backups of the site, though...)

Link to comment
Share on other sites

Problem here is, some ISP's like to save money by caching DNS records regardless of what you set the TTL to. TTL stands for Time To Live and is how often your DNS records should be checked for updates (it is common to use something like 1 hour or so). You can certainly shorten this up to something like 1 minute so that as soon as you change your DNS it is changed all over the world. Problem is, this puts a bunch of strain on the ISP's who run DNS servers for their customers. So some ISP's (and I won't name names) like to "cache" these records for longer than they are supposed to. I don't know if your school is affected by this or not.

 

There is really only two different ISP's you can get where I live. One of them is Verizon, which I don't have, so I can't know what their TTL is, but my ISP I know (with a 95% certainty) that the default TTL is only 10 minutes. But still, I understand what you're saying.

 

It doesn't seem as if I have many choices unless I can find a free DNS host.

 

(Or I could install portable XAMPP on my flashdrive. Knowing me, I'd forget to save backups of the site, though...)

http://afraid.org

Link to comment
Share on other sites

Thanks Wizard, I was already looking into that, but I have a somewhat related question.

 

I'm sort of new to this kind of thing, so: My domain is a co.cc subdomain, which allows you to have more than two name servers.

 

Would I be able to set the first two nameservers to the heliohost name servers, and for the third one, set it to my IP address?

 

Or do I need to have BIND installed on my computer for that to work?

 

Thanks for your help,

~Derek

Link to comment
Share on other sites

Thanks Wizard, I was already looking into that, but I have a somewhat related question.

 

I'm sort of new to this kind of thing, so: My domain is a co.cc subdomain, which allows you to have more than two name servers.

 

Would I be able to set the first two nameservers to the heliohost name servers, and for the third one, set it to my IP address?

 

Or do I need to have BIND installed on my computer for that to work?

 

Thanks for your help,

~Derek

AFAIK, nameservers can only be pointed at one place. I don't have any deep experience with this situation, so I'm reluctant to say anything past "Google is your friend."

Link to comment
Share on other sites

Well, because I know all the name servers do is it tries the top one, if it's down, it tries the next one on the list.

 

So I'm going to be searching around if the nameserver can be an apache installation, or if it has to be a DNS server.

 

I tried just adding in my IP address for the first nameserver to see if it will not go to Heliohost, but it says it needs to be a url, not an IP address. I'm going to make a DynDNS or a No-IP or something and try again.

 

Thanks,

~Derek

Link to comment
Share on other sites

Most domain registrar are willing to be your DNS providers as well. You can set your NS records to point to them, and then set an A record to point to HelioHost. You could decrease the TTY on the A record at the registrar to something low, but as rvt said this probably won't have a huge effect.

 

Alternately, you could use an off-site DNS provider (such as DynDNS or afraid.org) and do the same thing or something similar.

Link to comment
Share on other sites

Most domain registrar are willing to be your DNS providers as well. You can set your NS records to point to them, and then set an A record to point to HelioHost.

 

Yeah, I'm using Co.CC and they do in fact have a free DNS service too.

 

So I was thinking I could set up a "home" A record to my house...

 

But what value would I put for Heliohost? Nameserver1?

Link to comment
Share on other sites

Regarding your ISP's TTL: It isn't just your ISP's TTL that you have to worry about. You have to worry about every ISP in the world because they all cache your DNS records. So just because your ISP uses a TTL of 10 minutes, doesn't mean that my ISP uses a TTL of 10 minutes. I can name a couple of ISP's offhand that not only cache DNS records, but also copies of your website all in an effort to cut down on their bandwidth costs. This causes major issues for webmasters who make changes to their site and notice no change.

 

Regarding running a name server on your computer: Obviously you can't use Apache to serve DNS records because Apache is a web server, not a DNS. Apache listens on port 80, DNS is port 53 (I think). So BIND or some other DNS software would be required.

 

Regarding setting DNS records: You can certainly manage your own DNS for your domain by pointing the name servers where ever you like. You would then need to create an A record for youdomain.com (commonly abbreviated as @) pointing to the IP address of your site here. Then create a CNAME record for "www" pointing to your A record (which you abbreviated as @). Keep in mind that if Heliohost is down, chances are the Heliohost name servers are also down since they are on the same server.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...