Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-18-2007, 11:36 PM
|
#1
|
LQ Newbie
Registered: Feb 2007
Posts: 5
Rep:
|
setup primary,secondary dns records webmin
Hello,
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.
thanx
|
|
|
02-19-2007, 12:26 AM
|
#2
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
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.
Peace,
JimBass
|
|
|
02-19-2007, 01:03 AM
|
#3
|
LQ Newbie
Registered: Feb 2007
Posts: 5
Original Poster
Rep:
|
Thanx Jim Bass i'll try your suggestion.
Actually i prefer the command line but in the past i tried to solve some problems with the command line and found out that i could have done that using webmin very easily.
|
|
|
02-19-2007, 04:35 PM
|
#4
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Rep:
|
Code:
[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 66.102.7.104
www.l.google.com. 258 IN A 66.102.7.147
www.l.google.com. 258 IN A 66.102.7.99
[phillips@karratha ~]$
Can anyone tell us how does Google does it...?
|
|
|
02-19-2007, 04:50 PM
|
#5
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
Sure, they round robin the A records. You can have many A records for the main site. Which one your browser selects is picked at random from that list.
All you have to do is list multiple addresses, something like
Code:
7200 IN A 45.56.67.78
7200 IN A 23.45.67.89
7200 IN A 12.34.56.78
Peace,
JimBass
|
|
|
02-19-2007, 05:03 PM
|
#6
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Rep:
|
Wouldn't that achieve what meema is attempting to do...?
|
|
|
02-19-2007, 05:29 PM
|
#7
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
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.
Peace,
JimBass
|
|
|
02-19-2007, 06:02 PM
|
#8
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Rep:
|
Fair enough - thanks JimBass...
Basically a very crude method to achieve something close to the desired result.
|
|
|
02-21-2007, 08:31 AM
|
#9
|
LQ Newbie
Registered: Feb 2007
Posts: 5
Original Poster
Rep:
|
thanx all...
what if the two servers were in different networks i.e. we deal with public IP addresses
|
|
|
02-21-2007, 09:28 AM
|
#10
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
DNS servers are supposed to be in different public networks. It is suggested that any public DNS servers for a domain be in 2 different public class C networks.
If you were talking about the web servers addresses, that also is fine. You can return any valid IP address in the world for your domain.
Peace,
JimBass
|
|
|
All times are GMT -5. The time now is 12:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|