Delete all adlists and whitelists in one step possible

Hi there,

I run pi-hole (Pi-hole v5.1.2) on a raspberry pi since a couple of months. Basically I'm pretty satisfied.
Just wonder if there's a way to delete

  • all adlists
  • all whitelists
    in one step. I don't find a possiblity on the webinterface, but perhaps there's a script available or something similar. If I would delete them manually it would take alot of time.
    During the months I blindly added more and more lists and right now I think it's better to start from scratch with new adlists as I lost the overview... I think it's better to start new again with new adlists and configure groups to use the adlists or not.

BTW: What are the recommended and most helpful adlists for German users?

Thanks for your assistance.

You can do this with SQL commands from the terminal on the Pi.

Delete all adlists:

sudo sqlite3 /etc/pihole/gravity.db "DELETE FROM adlist;"

Then you would need to rebuild gravity with pihole -g to remove the adlist contents from the gravity list.

Or, if you are going to replace your adlists with new adlists, delay the gravity rebuild until you have the new lists added. Then the old will be removed and the new added in one step.

Delete exact whitelist:

sudo sqlite3 /etc/pihole/gravity.db "delete from domainlist where type=0;"

Delete regex whitelist:

sudo sqlite3 /etc/pihole/gravity.db "delete from domainlist where type=2;"

After you have cleared the whitelists you want to clear, run pihole restartdns reload-lists

1 Like

Thanks - worked perfect!!!

Just wonder if you can help with the other question:
What are the recommended and most helpful adlists for German users?

I will defer to users in Germany. I'm in the US and I use the default blocklists plus a few regex.

Thanks for the reply.

Any German reader here who can help?

Es gibt meines Erachtens nicht die eine geeignete deutsche Liste, es kommt wirklich sehr auf dein Surfverhalten drauf an. Um zu schauen, welche Adlisten für mich am Besten passen, habe ich mir ein kleines Tool geschrieben.

Wenn ich damit mein Surfverhalten der letzten 3 Monate analysiere, dann sind für mich folgende Listen am nützlichsten

id          enabled     total_domains  domains_covered  hits_covered  unique_domains_covered  address                                                                      
----------  ----------  -------------  ---------------  ------------  ----------------------  -----------------------------------------------------------------------------
26          1           218702         945              122990        309           
13          1           37094          170              8463          8                
15          1           674            100              97131         7                  
17          1           8882           8                8             7             
21          1           200            11               2566          4                       file:///home/nanopi/blacklist_spy-adware.txt                                 
24          1           1150           24               703           4             
43          1           23800          93               18983         3                
1           1           55481          549              133279        2                          
3           1           20567          308              46273         1                                                          
16          1           69             2                2             1             
23          1           1058           64               5375          1             
44          1           196025         1                1             1                 
50          1           15057          61               12876         1              

1 Like