librelist archives

« back to archive

Setting proxy with names

Setting proxy with names

From:
Christian Bayle
Date:
2011-11-28 @ 10:24
Hi,

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.

where should I look in the code if I want to add this ?

Christian

Re: [redsocks] Setting proxy with names

From:
Leonid Evdokimov
Date:
2011-12-06 @ 10:17
On Mon, Nov 28, 2011 at 14:24, Christian Bayle
<christian.bayle@orange.com> 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 :)


--
WBRBW, Leonid Evdokimov
xmpp:leon@darkk.net.ru && http://darkk.net.ru
tel:+79816800702 && tel:+79050965222

Re: [redsocks] Setting proxy with names

From:
Christian Bayle
Date:
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 
some post-up
command possibly combined with guessnet 
(http://guessnet.alioth.debian.org/FAQ.html)

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.

Cheers