Bear with me folks.
I think I have a use case to create my own personal blocklist.txt file, which I'd like to contain a mix of blocklist sites, and whitelisted sites..
I can see how to create a .txt file with site blocklists.
However I cannot see the syntax to add white list rules..
...I have a suspicion in may deliberately not be possible - to prevent adlist creators whitelisting their own pet sites..
Hence the post - is this possible to create my own custom .txt files with both regex blocklists and whitelists, which I can then add as an adlist to my pihole.
Why am I doing this?
- I have pihole that runs as a general ad blocker for my home network. It works very well
Occasionaly I disable blocking so we can follow a sponsored link for shopping etc - but usually it sits there and does its job very well.
-It has one set of rules (block and whitelist) which is applied to everything.
My kids (young) now have a machine they use for their schools studies.
I have set up a 2nd pihole, which acts solely as DHCP and DNS for the kids machine, which is running a "block everything" regex, with then explicit whitelisting for school and education sites that they need to access. Which includes a whole heap of CDNs etc. This second piholes uses the original pihole for DNS - so in effect inherits all the blocking rules from the first as well.
- (and yes I know - the better solution would be to invest in an actual firewall to do traffic blocking rather than just DNS blocking, which at some point, I'm sure my kids will figure out how to bypass - and for which I will be secretly proud of them for doing so (but probably note tell them)
Anyway.. back to the use case.. so I have a 2nd pihole now set up with a "block everything regex", and customer set of whitelists - some exact, some regex.
In theory - I could do all of this on just a single pihole, using client groups to put the kids machine in its own group with its own dedicated set of "strict" blocking rules, that block everything except the small set of custom whitelist sites.
To do so, I would need to merge the blocklist (well - block everything rule) and the custom whitelist back into the original pihole ruleset, put them all into a dedicated group, and use client based filtering to put just the kids machine into the group.
However this requires me to be able to import the rules back into the 1st pihole, and assign them to a their own category.
It occurred to me, if I could extract rules these from the teleporter backup .json files, I could create my with .txt adlist file, including both the blocklist and whitelisting, then just add it to as an adlist entry into original pihole, in its own dedicated group, which only the kids machine made use of.
Now whilst I can see how to create a ,txt file with blocklisted domains, I cannot see who to create a ,txt file with regex blocklists, or whitelisted domains.
I've tried searching the pihole documentation for the adlist.txt file syntax, however have only found how to add blocklisted domains.
Am I searching for something that isn't there? Or am I being dumb.
Or is there a simpler way to import one piholes configuration into another, whilst retaining the original piholes configuration.. (ie adding to it, not replacing it)
Thoughts appreciated
And apologies for the long post.