Results 1 to 1 of 1
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Oct 2007
How to use IPTables for redudancy and redirecting?
The way I currently have it is via a script which does the following:
1. Connect to the current primary server.
2. If primary server is down then seek next available
3. When next available is found, modify DNS zone file (change cname to direct to the new address)
4. Restart services (named/httpd)
5. Attempt to connect to primary server occasionally
6. When primary is back online, modify dns, restart
7 Rinse and repeat
That method is terribly inefficient, and I would dearly love to be able to track how much traffic goes through the redirector service.
Is there a way I can set it up so the server can do the same as above, without restarting the named/httpd services, via iptables or any other method? Hopefully there's a much better and more efficient method to achieving that. If you know how I can accomplish that, is there also a way I can also track traffic of people using the redirector service (mainly how many connects regardless of ip per day, how many unique IPs per day)?
A friend on a different forum (@ mediatemple website) told me this:
To accomplish the same ends as the DNS list, you could employ a routing table and local DNS on your server that maintained that list. Running DNS/Bind on your server is a much better option than hacking the primary DNS records for your server, and I should have thought of that first...! big_smile
In this method, requests to [sub].[domain].[tld] would be routed to the IPs on the list instead of redirected, so content would be served by your own machine from those external hosts. It occurred to me that the programatic passthrough was a lot like a router... Wait, servers are routers! Duh! You could perform much of the same integrity tests with a local DNS, so look into that. Hope you've got a (dv) for this...! smile