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

From: Jenny Lee <bodycare_5_at_live.com>
Date: Thu, 27 Oct 2011 01:08:42 +0000

> 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:08:50 MDT

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