Re: [redsocks] Setting proxy with names
- Christian Bayle
- 2011-12-13 @ 09:07
Le 06/12/2011 11:17, Leonid Evdokimov a écrit :
> On Mon, Nov 28, 2011 at 14:24, Christian Bayle wrote:
>> In the redsocks config, it would be very nice to be able to setup
>> a dns name instead of an ip adress
>> ip = myproxy.mynetwork;
>> instead of
>> ip = 10.0.5.2;
>> this because proxy can be a round-robin or different depending on the place
>> you are in the network.
> You have to answer following questions before implementing that:
> 1. Are you going to query DNS for every connection (performance
> penalty), are you going to query DNS at startup time (kills roaming)
> or are going to cache DNS reply (proper caching is hard)?
> 2. if you're going to cache it, are you going to respect DNS TTL and
> are you willing to accept the fact, that DNS is not the only source of
> information if you're going to use gethostbyname() ?
>> where should I look in the code if I want to add this ?
> The easiest way is to add this logic to config parser and to keep
> resolved addresses until shutdown :)
I think I will prefer the in config parser solution,
for roaming I think it's better, at least for debian
to fire up redsocks config changes in /etc/network/interface by adding
command possibly combined with guessnet
One effect of having name is to simplify the config if your
infrastructure provide a generic proxy
e.g. proxy.exemple.com, so you don't have to have a specific redsocks
confg file for every place you move to.