You are looking for "DNS Failover". There are some online services that provides that. (Despite the disadvantages, it is my favorite for non mission critical services, see below).
You may also want to hear the critics.
DNS Failover is a service where the DNS server checks with certian techniques the availability of your servers, and when one of them fails to respond, the DNS changes the record to point to the other server.
By now you can see why this solution is not good enough, browsers/computers may cache your initial server (now broken) address and talk to its IP even after it is down.
Every alternative has its pros and cons, most of the reasonable simple solutions are Single Point of Failure. it all boils down to "who do you prefer to blame" or who should deal with the spof.
One alternative is to have the server provider do the redundancy.
See this on about Amazon solution.
It also depends on your setup and what do you want to protect.
If both server are in the same lan, you can simple set a floating IP address and let the router decide who's active, this method requires access to the router, and its caviate is that the router just pings, doesn't actually check the service, which is the same with most of the solutions.