0

I am using mod_proxy for my forward proxy server and I would like to use another proxy using ProxyRemote. It works OK, the point is I have 5 more proxies I would like to use that way and I can set just one of them in httpd.conf

Do you know a way to dynamically select random proxy ip and use for each request ?

1

Use round-robin DNS to serve up a different one of the 6 IP addresses for your proxy hostname, every time it's used.

Basically the technique is just to define multiple A records for your hostname. The records will then get served in order as requests come in, giving a rotating set of results. See for example the load balancing section of the Zytrax DNS book. But you should check with your DNS provider to be sure.

  • It looks like good idea. Can you give some example ? Can I just add those 6 proxy IPs to my local DNS configuation file under the same domain ? Should I use some external domain or some local will be enough ? Thank you for the idea. – knm Sep 25 '14 at 16:40
  • Yes, that's what you do. I added more information. – Andrew Schulman Sep 25 '14 at 16:55
  • thanks. added them to localdomain.zone file. then restarted named - nothing happened. had to do - rndc reload, after just one IP was used for proxy.localdomain. had to add - rrset-order {order random;}; to named.conf options. now is good. – knm Sep 25 '14 at 21:33
  • I have just one problem with this setup. I have many proxies set in localdomain.zone file , all of them as A record but when I test it , it always uses just one subnet, I think the closest to my server ip. Any idea how to set DNS not to match the closest subnet and use all IPs I have assigned to proxy.localdomain ? – knm May 16 '15 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.