Re: [squid-users] Is there any way to configure Squid to use local /etc/hosts in name resolution?

From: David Wake <dnwake_at_gmail.com>
Date: Wed, 26 Oct 2011 18:30:37 -0700

Hi Jenny,

Thanks very much for replying to my question. I'm a bit confused --
are you saying that you don't see my problem on your Squid 3.2
installation?

My /etc/resolv.conf just reads

search XXX
nameserver XXX.XXX.XXX.XXX

I did try restarting squid after I had changed /etc/hosts, but it made
no difference.

Thanks for any further help you can give!

David

On Wed, Oct 26, 2011 at 6:08 PM, Jenny Lee <bodycare_5_at_live.com> wrote:
>
>
>
>
>> Date: Wed, 26 Oct 2011 17:28:21 -0700
>> From: dnwake_at_gmail.com
>> To: squid-users_at_squid-cache.org
>> Subject: [squid-users] Is there any way to configure Squid to use local /etc/hosts in name resolution?
>>
>> Hi there,
>>
>> I'm using Squid 3.1 as part of a proxy chain. I'm trying to make
>> Squid use the local /etc/hosts file for name resolution before
>> forwarding the request to the next proxy in the chain, but I've been
>> unable to make it work, even by explicitly using the hosts_file
>> directive. I'd be really grateful if anyone could help!
>>
>> Here's an example:
>>
>> I'll access a website normally via the proxy, with no weirdness in /etc/hosts
>>
>> > cat /etc/hosts
>> 127.0.0.1 localhost.localdomain localhost
>> > echo $http_proxy
>> http://localhost:3128
>> > curl http://yahoo.com
>> The document has moved here.<P>
>> <!-- w33.fp.sk1.yahoo.com uncompressed/chunked Wed Oct 26 17:12:17
>> PDT 2011 -->
>>
>>
>> Now I'll change /etc/hosts to point yahoo.com to google.com. Notice
>> that the proxy doesn't respect this: it still goes to yahoo.com
>> rather than google.com.
>
>>
> DNS responses are cached both by squid and local resolver. Are you reloading squid at this point? My 3.2 works fine with /etc/hosts mods
>
> I am assuming order is alright in /etc/resolv.conf (judging from the tests below I will say it is).
>
> Jenny
Received on Thu Oct 27 2011 - 01:30:45 MDT

This archive was generated by hypermail 2.2.0 : Thu Oct 27 2011 - 12:00:08 MDT