How do I set up failover for a single web server using two ISPs?
I imagine this is a very common issue.
Actually no. Most even smaller websites run with hosters who handle that. The hoster has multiple uplinks, his own address space and announces his routing via BGP to the peers.
This is also a lot more bandwidth efficient as basically... the uplink speed of a typical end user connection is horrible.
I would say that most people "unprofessional" enough to try running a website from behind a cable / DSL link.... also do not have two connections.
I think the most 'real' way to do it is to get a block of IPs and then announce them to the Internet yourself to both ISPs with BGP. This would be with more of a 'real' connection that cable and dsl. For those levels of connections I think using DNS failover is probably on par with your setup.
I normal next stage would be to move to collocation and get a stable connection from an ISP offered at the collocation facility or the datacenter itself. They can give you two drops that use HSRP probably and they can go right into a switch or switches. This won't be perfect full redundancy but a large step forward.
Updating the DNS is the lynchpin here. Round Robin DNS (multiple A records) doesn't do any health check by itself. What type of multi-wan router are you using? I know the PepLink Balance series include a DNS server on the router that will change the records when its links go down. If your router can't do this itself, you're probably going to need to write a script or find a service that externally health checks/polls both connections and updates the DNS server periodically.
Also, for those suggesting coloc - while this is an ideal answer for a production sever, chances are that this is a staging/development server that might be mounting or acting as the office file server, where the access speed from the LAN is more important than the uplink speed and stability.
you can balance incoming traffic to your web server on both wan lines with an inbound load balancer. There are load balancer with a DNS server inside them (www.alvaco.com) the load balancer will connect to both WAN lines and the lan side of the load balancer can connect to your firewall or directly into your lan. The domain for your web site needs to be hosted in the lb, thus making the lb the SOA or parent dns server for that domain. This is accomplished by going to your domain name registrar and having them change the Parent DNS for your domain to the ips that terminate in the load balancer. From that point on, any query regarding any A or other record will come to the load balancer to be resolved. Since the load balancer has also 2 wan lines connected to it, it will offer the IP of the line that is best for him. The load balance will inbound load balancing and failover (if one line is down, it will not offer that IP).