Forum Moderators: open
This is usually an extra-cost option, though some providers will provide some free with a package deal. I think my DNS provider gives failover for 3 domains with their 25-domain "business" package.
They monitor your website, and if it goes down, switch the DNS to point to the backup.
You need to set a small TTL (time-to-live) on DNS (say, 5 minutes) for this to work. Keep in mind that you will still leave a few users in the lurch.
There are other ways to do this, but this is perhaps the most reliable. Your site is being monitored and your DNS provided by a reliable distributed network, rather than from a single point.