Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How can i configure the dns server using webmin to have primary and secondary dns records, such that if the primary web server is down, the secondary dns record will point to the secondary web server and the service wont be affected.
That is not something that can be done with DNS alone. DNS has no way to check and prioritize servers. Actually it can prioritize, but there isn't a browser client in the world that checks for these records at present.
Your options to do something like this include:
Look into the linux-ha project at http://linux-ha.org/ . It is an open-source way to build a cluster of webservers.
A tougher way to do what you want with the machines you already have would be a step by step check, something like this:
1) Install a network monitor tool like nagios (http://nagios.org ) , have it check the primary and secondary webservers. If the primary check fails, it should execute a script on the primary DNS server that loads a new zonefile for your domain that only has the secondary webserver. This will require some shell scripting to alter the zonefile, or call on a secondary file from somewhere, and restart BIND with the new configs.
2) This will NOT work for all the people who are "already" or "recently" looking at your site. If they have asked for the A record for your site, they will keep that record for as long as the TTL is. Until that TTl expires, they will still try to look at the site at the address of the server that is down. To combat this, you'll want a really low TTL (like 60 seconds or less), but that will cause a ton of lookups on your DNS servers, so if bandwith or load is already a problem for you, that won't help any.
The fact that you're using webmin makes me think you are staying away from the command line, and to accomplish what you want here, that just won't work. You've got to get dirty with the code to make something like what you want (99.99% uptime) happen.
[phillips@karratha ~]$ dig www.google.com.au
;; ANSWER SECTION:
www.google.com.au. 93818 IN CNAME www.google.com.
www.google.com. 266613 IN CNAME www.l.google.com.
www.l.google.com. 258 IN A 220.127.116.11
www.l.google.com. 258 IN A 18.104.22.168
www.l.google.com. 258 IN A 22.214.171.124
Not quite. It does allow failover to happen, but it doesn't keep the servers in a primary/secondary role. With 2 A records for your domain, you should (in a perfect world) see 50% of your traffic go to the first IP, and the other 50% go to the second. You can't use it like a mail exchanger, where you can set priorities on which one to use. If you have a situation like unequal bandwidth, you don't want an even split of traffic between them.
It basically doesn't allow a primary secondary relationship, it makes everything equal.
Also in reality, many browsers don't respect the multiple A records, and automatically take the first record given. If you could see google's stats for the 3 addresses you found when you asked for google.com.au, you'd see the first record returned gets probably 70% of the traffic I would guess.