How to setup main and backup web server?

I have 2 workstations running identical web pages/sites. My intention is to have a backup to the main machine.

1) How to set up the DNS to do the sharing of the web servers? I just need to enter 2 IPs with the same site name? or
2) Can I use the main DNS server to define the main machine IP? and the backup DNS server for the backup machine IP?
3) How to check whether the main server is down and the backup server has to take over?

The OS is Fedora. Web site is, IP for the main machine is a.b.c.d and IP for the backup machine is Really appreciate if someone can show the zone files including MX, A, CNAME records, etc.


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Unfortunately, it's not quite as simple as setting up the proper DNS records.  The first thing you have to do is set up data mirroring so that the data is copied to your backup server automatically.  The second element is DNS Failover, which monitors your primary server and if it goes down, automatically starts giving out the IP for your backup server.

Here is a good thread that discusses this in more detail:

If you're looking for a simpler solution, ZoneEdit ( offers a failover service.  It's not perfect, but it's probably your cheapest option.  From their website:

"Failover monitoring service works when you have two or more web servers running the same (or similar) web site.

    * First, you need the IP address for your domain, and get it working - then you add the failover monitor.
    * The failover monitor watches your web server(s) by hitting a URL you specify and looking for text in the results.
    * When the system detects that one of them is having an error, and the others aren't, it pulls the IP address out of the list.
    * If none of the IP's are responding and you have a failure IP/URL defined, then it points the site to the failure IP/URL.
    * If the system can't get to all of the IP's then it assumes that the fault is it's own connection - and it takes no action.
    * If any of your IP's come back online they are restored

This effectively and safely keeps your site online - even if one of your web servers is down.

The average failure detection time is 10 minutes. This time varies depending on the speed of your site and the nature of the failure. Recovery times are faster, averaging 5 minutes. "

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ccjongAuthor Commented:
Thanks for the help.
Glad to be able to help out.  Good luck.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.