Re: using squid with dnsmasq



* Troy Piggins wrote :
I'm using squid3 as a transparent proxy by redirecting port 80
in iptables, and dnsmasq as well. This all works fine. But now
I'm trying to utilise the mvps hosts file to block malicious
URLs and am having trouble getting squid to recognise this hosts
file.

On a previous installation I had the mvps hosts file saved as
/etc/hosts.mvps and set up dnsmasq to read this file as an
additional hosts file. I changed the IP addresses in the mvps
hosts file from 127.0.0.1 to 192.168.0.100 and set up a virtual
IP address and web page so that if a browser on the network
wanted to connect to a URL that was in the hosts file, the user
would get a locally served page saying "sorry, malicious site
blocked" or something like that. I thought that was all pretty
cool.

So now I have the same setup, but have installed squid as this
transparent proxy. It is all working fine... except that squid
seems to be bypassing the /etc/hosts.mvps file.
So normal pages are viewed fine.
And if I ping one of the mvps hosts from the commandline it
correctly returns the IP address 192.168.0.100.
And if I put the URL 192.168.0.100 in a browser I get the correct
blocked site message.
But from a browser if I try to view a website listed in the mvps
hosts file, I don't get the blocked site message page, I get the
real (malicious) one.

IIUC squid should be reading /etc/resolv.conf for DNS? Mine is

nameserver 127.0.0.1
search isp.invalid

And so if it's using localhost and DNS, that's dnsmasq and the
mvps hosts file should come into play.

What am I missing?

As an alternative, I've seen reference to using mvps entries
somehow in squid.conf acls or rules, but haven't found a good
explanation of /how/ to do this or examples. Any pointers there
if that's the better way to go?

Hope I've provided enough details.

No ideas?

--
Troy Piggins
.



Relevant Pages

  • using squid with dnsmasq
    ... in iptables, and dnsmasq as well. ... URLs and am having trouble getting squid to recognise this hosts ... On a previous installation I had the mvps hosts file saved as ...
    (comp.unix.admin)
  • Re: System Security virus - PCBUTTS Exposed as a thief
    ... You are spending an inordinate amount of time and energy defending the ... Their inclusion of those entries is a very weak, ... A good hosts file should not interfere with a user's deliberate ... The mvps hosts file no longer qualifies as a good hosts file. ...
    (alt.comp.anti-virus)
  • Re: MVPS HOSTs file changed unexpectidely?
    ... Keith (Southend) wrote: ... When I checked the HOSTS file was only 1Kbit compared with the 400 or Kbit. ... I've just put back the MVPS HOSTS file and all is blocked once again. ...
    (alt.computer.security)
  • Re: "Back button problem" when using a Hosts file
    ... I use SpywareBlaster, it adds most of what's in the MVPS HOSTS file to ... and I don't want to add them all to Restricted Sites. ...
    (microsoft.public.windowsxp.general)
  • Re: Problem Infection??
    ... I am really growing to love the hosts file;-) ... I browse through an OpenBSD firewall running a Squid proxy. ... contains a thousand or more domain names (incl wildcards) ... Squid blocks access to all those sites, ...
    (sci.electronics.design)