just set up my Pi-hole yesterday on a Pi 3 Model B with Raspbian; and I must say that I'm impressed, both regarding the painless setup process and the smooth usage.
Now, I want to transfer a number of hostnames (around 10,000) from my customized local hosts file to the blacklist.txt. However, I couldn't find a good way to easily add this number of hostnames. Here's what I tried:
Entering each through the dashboard is obviously not an option due to the sheer number of hostnames.
I tried to copy&paste the hostname list into a terminal line as pihole -b hostname_1 hostname_2 [...] hostname_n - but just the parsing on the screen took ages, and I felt that I might overburden my Pi by shoehorning 10,000+ arguments in one line, so I canceled that approach
Directly editing the blacklist.txt failed, too (it was write-protected when trying via SSH).
Is there a good approach for my task? As a workaround, I could of course add a link to my hosts file to /etc/pihole/adlists.default, but this seems clunky. Also, I was wondering if it is recommended to weed out duplicates from other lists (for performance or other reasons)? If so, is there an easy way to do so?
Thanks much and kudos again for the Pi Hole project!
We source hostlists from various locations around the Internet. So the best way would be to mimic our current approach. Set up a private GitHub repository, or even set up something like Apache2 on the Pi 3 itself, to serve your hosts list as a file. Then just add the URL to the adlist that you can customize per the instructions in the header, and your list will fall right in with all the other domains. Deduplication and unification is already handled by the scripts.
So the blacklists.txt approach seems to be for the occasional manual hostname addition only? That would explain why I couldn't find a way to resolve my issue...
I'll try your suggestion and will make an addition to adlist. Can I find additional information somewhere about the results of my efforts? I know there's the total hostname count in the dashboard; if I can evaluate additional stats (e.g. number of duplicates found) that would be great. Thanks!
We currently don't measure any metrics like that, but that does sound like a great feature to have, what values would you be interested in seeing. And would the current way we echo the values out via the gravity.sh output work, or would you be looking for something more along the lines of an api call that listed the values?
Hey! I'm also really new to Pi Hole and also impressed of its power and easy way install. But I have some problems understanding the usage of 'adlist'.
to the domain list using "http://pi.hole/admin/queryads.php" But that seams to be a wrong way to add stuff because I get the failure message "Invalid domain!"
What's the correct way to use the "adlist" function? (I know this is probably a really simple question but I can't figure it out reading the topics )
You are trying to add a URL where a domain is required. The domain is just github.com which I don't think you want to do. And queryads.php is the page to find if a domain is currently on any sourced lists.
@spacemonkey has the link that you should follow if you'd like to add that entire list to your blocking.