<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Jul 17, 2008 at 11:54 PM, Troy Piggins &lt;<a href="mailto:troy@piggo.com">troy@piggo.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Not sure if this is a squid or dnsmasq problem, so hope you don&#39;t<br>
mind me asking same question in 2 lists.<br>
<br>
I&#39;m using squid3 as a transparent proxy by redirecting port 80<br>
in iptables, and dnsmasq as well. &nbsp;This all works fine. &nbsp;But now<br>
I&#39;m trying to utilise the mvps hosts file to block malicious<br>
URLs and am having trouble getting squid to recognise this hosts<br>
file.<br>
<br>
On a previous installation I had the mvps hosts file saved as<br>
/etc/hosts.mvps and set up dnsmasq to read this file as an<br>
additional hosts file. &nbsp;I changed the IP addresses in the mvps<br>
hosts file from <a href="http://127.0.0.1" target="_blank">127.0.0.1</a> to <a href="http://192.168.0.100" target="_blank">192.168.0.100</a> and set up a virtual<br>
IP address and web page so that if a browser on the network<br>
wanted to connect to a URL that was in the hosts file, the user<br>
would get a locally served page saying &quot;sorry, malicious site<br>
blocked&quot; or something like that. &nbsp;I thought that was all pretty<br>
cool.<br>
<br>
So now I have the same setup, but have installed squid as this<br>
transparent proxy. &nbsp;It is all working fine... except that squid<br>
seems to be bypassing the /etc/hosts.mvps file.<br>
So normal pages are viewed fine.<br>
And if I ping one of the mvps hosts from the commandline it<br>
correctly returns the IP address <a href="http://192.168.0.100" target="_blank">192.168.0.100</a>.<br>
And if I put the URL <a href="http://192.168.0.100" target="_blank">192.168.0.100</a> in a browser I get the correct<br>
blocked site message.<br>
But from a browser if I try to view a website listed in the mvps<br>
hosts file, I don&#39;t get the blocked site message page, I get the<br>
real (malicious) one.<br>
<br>
IIUC squid should be reading /etc/resolv.conf for DNS? &nbsp;Mine is<br>
<br>
 &nbsp;nameserver <a href="http://127.0.0.1" target="_blank">127.0.0.1</a><br>
 &nbsp;search isp.invalid<br>
<br>
And so if it&#39;s using localhost and DNS, that&#39;s dnsmasq and the<br>
mvps hosts file should come into play.<br>
<br>
What am I missing?</blockquote><div><br>I don&#39;t know a whole lot about squid, just that it is a caching proxy.&nbsp; And as a result, as alternative configurations you tried might not have been properly tested if you didn&#39;t wipe the cache.<br>
<br>If you intend to troubleshoot, I&#39;d suggest clearing the squid cache and then running wireshark, listening to udp and tcp port 53 while you browse to one of the blocked pages.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
As an alternative, I&#39;ve seen reference to using mvps entries<br>
somehow in squid.conf acls or rules, but haven&#39;t found a good<br>
explanation of /how/ to do this or examples. &nbsp;Any pointers there<br>
if that&#39;s the better way to go?<br>
<br>
Hope I&#39;ve provided enough details.<br>
<font color="#888888"><br>
--<br>
Troy Piggins<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</font></blockquote></div><br></div>