Guspaz wrote:
The closest thing to what you describe is round-robin, but that isn't failover; you'll still be handing out the downed IP to a certain percentage of users.
Right, round-robin is more about load sharing than failover.
Of course, DNS itself can return multiple addresses for a single host, so another option is just to put multiple A records in DNS. In that case clients (at least most of them) will automatically try each address in turn, so while the first address may be bad, there will be failover to the latter addresses which can work. This has its own downsides through. First, depending on how the first address fails, it could take a significant timeout (30+ seconds) to try the next address. Second, technically such a DNS response indicates any of the addresses are valid, so a client could randomly choose an entry if it so desired, though I'm not sure any mainstream clients ever do this.
For mail though, as pointed out in jsr's response, MX records are absolutely the way to go - it's what they're designed for. Multiple A records also work, but MX records avoid their ambiguity in terms of precedence.
In the non-mail case, getting even more complex, but just for completeness, Linode offers another possibility which is to enable a single address for use on more than one Linode (the IP failover configuration on the network tab of Linode Manager). Then clients still use a single address from DNS but it hits the other box. But it's up to you to figure out when to activate that address on the backup box, so you have to setup some sort of inter-box monitoring on your own or a package that provides for it.
-- David