If you are making use of Pihole's regex filtering and/or DNSMASQ wildcards, then it's likely that your gravity.list
contains far more domains than necessary.
Regex:
^(.+[-_.])??ad[sxv]?[0-9]*[-_.]
matches 19,268 unnecessary entries in my gravity.list
file.
DNSMASQ Wildcard:
address=/302br.net/0.0.0.0
matches 16,327 unnecessary entries in my gravity.list
file.
- Identifies
gravity.list
entries that do not match items in yourregex.list
- Identifies
gravity.list
entries that do not match items in anyDNSMASQ
conf files. - Creates a new, optimised
gravity.list
- All commands will need to be entered via Terminal (PuTTY or your SSH client of choice) after logging in.
- Each time
pihole -g
is ran, either through updates, automatic cron or manually, any entries that were previously removed by this script will be re-added.
sudo bash
wget -qO /usr/local/bin/gravityOptimise.sh https://raw.githubusercontent.com/mmotti/pihole-gravity-optimise/master/gravityOptimise.sh
chmod +x /usr/local/bin/gravityOptimise.sh
exit
45 3 * * 7 root PATH="$PATH:/usr/local/bin/" gravityOptimise.sh
gravityOptimise.sh
pihole -g
sudo rm -f /usr/local/bin/gravityOptimise.sh
pihole -g