notracking / hosts-blocklists

Automatically updated, moderated and optimized lists for blocking ads, trackers, malware and other garbage
2.31k stars 148 forks source link

Change domains.txt to format like hostnames.txt for PiHole #45

Closed beerisgood closed 6 years ago

beerisgood commented 6 years ago

With PiHole only your https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt list work, but with https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt i got Format: Dnsmasq (list type not supported)

So can you please change the format?

notracking commented 6 years ago

Hi there,

The domain name filter list that we supply should not be used as a hostname filter list (like you are trying to import in to pihole). If I remember correctly pihole does somehow support domain filters these days, but since I'm not a pihole user I'm not sure. Maybe someone else knows how to import domain filters in to pihole? It should work, because pihole in the end is only a backend for dnsmasq.

It would be nice if someone can add some intructions to our wiki on how to use the lists in cobination with pihole.

Mausy5043 commented 6 years ago

Pi-hole uses dnsmasq You can simply add your own .conf file in /etc/dnsmasq.d. For example: /etc/dnsmasq.d/99-my-settings.conf

Then add these lines to that file

conf-file=/path/to/where/you/download/the/domains.txt
addn-hosts=/path/to/hostnames.txt

Simple as that.

This also will survive a pihole -g 😉

notracking commented 6 years ago

Updated the readme, thanks for the help Mausy!

notracking commented 6 years ago

I've submitted a ticket in the pi-hole repos, regarding the loading of dnsmasq based lists (like ours): Ticket

ghost commented 6 years ago

Hi all,

yesterday I found your lsits and I wanted to experiment with pi-hole. What I noticed is that pi-hole can accept wildcards manually. It saves them in:

/etc/dnsmasq.d/03-pihole-wildcard.conf

So i wrote a (really bad) script to test:

#!/bin/bash
cd /tmp/
wget https://raw.githubusercontent.com/notracking/hosts-blocklists/master/domains.txt
sed -i -e 's/0.0.0.0/192.168.1.100/g' domains.txt
mv domains.txt /etc/dnsmasq.d/03-pihole-wildcard.conf

where 192.168.1.100 is just an example for a pi-hole ip.

This script can be added on a cron, while the other url with the hostnames, can be put as a pi-hole source.

What I did above works and is recognized by pi-hole, but I found two issues. The first is that the blacklist section of pi-hole interface crashes, because it's trying to print thousands of added rules.

The second issue is that in case of reboot /usr/bin/pihole-FTL is using 100% CPU for ages.

As you understand, I am far from being an expert. I just wanted to share with you what I found, in case someone else has a better idea.

Regards,

Michael

Mausy5043 commented 6 years ago

@archphile have you notified the pi-hole forums about this?
You should. They may be better suited to help you with issues you have with pi-hole.