I added to your bash script - also modified the line where you 'cp' and instead append - with your method, it overwrites the file after each run rm /etc/dnsdumpster/youtube-domains.txtĬat /etc/dnsdumpster/youtube-ads.txt > /var/www/html/youtube.txt Sure things could be better and if anyone has anything to add, please do tell me!Īll I know is that for me it seems to work using the above. I am by no means a linux/pi-hole expert, the above is what I did to make it work. This should run the script daily and might remove youtube ads. Save the file and edit your crontabs to automate the processĪdd the following line: 0 0 * * * /etc/pihole/youtube-ads.sh In this file add the following to the bottom: # My local list Now you should do the following to add your youtube.txt to the block lists in pihole: cp /etc/pihole/fault /etc/pihole/adlists.list ![]() Make the script executable: chmod x /etc/pihole/youtube-ads.sh Sed 's/\s.*$//' /etc/dnsdumpster/youtube-filtered.txt > /etc/dnsdumpster/youtube-ads.txtĬp /etc/dnsdumpster/youtube-ads.txt /var/www/html/youtube.txt Grep "^r" /etc/dnsdumpster/youtube-domains.txt > /etc/dnsdumpster/youtube-filtered.txt Python /etc/dnsdumpster/API_example.py > /etc/dnsdumpster/youtube-domains.txt It should contain the following code: rm /etc/dnsdumpster/youtube-domains.txt Next is to make a script in /etc/pihole, I named it youtube-ads.sh Now this should make the example api output everything that dnsdumpster shows/does To the following res = DNSDumpsterAPI(False).search('') You have to edit the line res = DNSDumpsterAPI(False).search('') Make sure you have python and pip installed and use the following commands: cd /etc/dnsdumpster If everything went according to plan you should now have 4 files in the above folder amongs which should be: /etc/dnsdumpster/API-example.py I cloned this git to a folder /etc/dnsdumpster/ with the commands: mkdir /etc/dnsdumpster So you will need the unoffical dns dumpster API from here: GitHub - PaulSec/: (Unofficial) Python API for ![]() However trough my (short!) tests I haven't seen any ads whilst using pi-hole to block the subdomains.Īnyhow, to automate a lot of the manual steps I made a script. I know that this might be inconvenient but rest assured that we had some sleepless nights, scratching our heads how to make it better and there seems to be no better way with the DNS resolver dnsmasq which we are using.Īccording to the above reply this might not work. Instead, the Pi-hole will immediately answer its own IP (regardless of the subdomain). If we now wildcard block none of the above steps will happen. This server will eventually be asked for the address of and will give us the final address to which we will connect. de server will know the host name and will return the address of the server that manages de and us an address for a server that knows all domains that are provided under. The root servers will be asked if they know. Let's oversimplify things a bit, so it gets more obvious why wildcard blacklisting does what it is doing: Let's assume we want to visit. ![]() No, the way DNS works is the limiter here. Would there not be any way to add a regular expression to the lists?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |