I use IPCOP and URL filter to block unintentional access to undesirable or high risk sites to reduce the risk of a ‘drive-by download’ attack, but have found that preventing access to sites using HTTPS using URL filter doesn’t work so I needed an alternative solution that would work for a small number of sites.

Since even when using HTTPS the web browser needs to be able to lookup the address of the web server it wants to connect to, the solution is to simply redirect DNS lookups for the domains I want to block somewhere else (in this case 127.0.0.1 seems to work quite well). Redirecting DNS lookups isn’t a perfect solution, it will prevent users accessing the affected domains using either HTTPS or HTTP, but they won’t be redirected to the ‘block page’ and nothing will appear in the URL filter logs. Also you don’t want to go mad and block too many domains this way. If you think you need to then you probably want to turn the problem on it’s head and block all HTTPS traffic except for a limited number of trusted sites, and there are other good reasons why you might want to do it this way as well.

IPCOP uses dnsmasq so to block a domain all you need to do is add an additional ‘address’ entry into ‘/var/ipcop/dhcp/dnsmasq.local’ for every domain you want to block. The entries below have been culled from a number of web pages that included annoying or unwanted advertising.