I am new to Pi-Hole but not to DNS filtering which I did years on my own.
Using wildcard filtering (address=/xyz.abc/[x.x.x.x]) in DNSmasq I was thinking how to reduce size/records in gravity.list. So I thought why leave the each record that is also covered by the wildcard records.
I reduced my domains number from 143K to 118K in this way. And if regex is also used it can be reduced even more.
If an wildcard/regex record is entered it not good to run the filter each time so an extra button to generate a filtered gravity.list on the blacklist page.
Removing a wildcard/regex means that all the external blocking-lists have to be read from scratch and then the new wildcard/regex are applied to new gravity.list
To make this all more manageable I could think of a page that shows all the records with the same top level domain grouped in pages. From this page it is easy to generate a new wildcard if the user wants to block the whole top level domain.
I had a quick-and-dirty script line that did the job for me:
Shortend version and this could also converted to a for-next that reads each wildcard\regex separate.
awk ‘!/302br.net|sandai.net|liveadvert.com|appier.net/’ gravity.list > gravity-1.list
I then duplicate gravity-1.list over gravity.list and then restart PiHole to have the updated gravity.list active.