| Crates.io | block-list |
| lib.rs | block-list |
| version | 1.1.4 |
| created_at | 2021-06-24 23:14:46.386862+00 |
| updated_at | 2021-07-02 11:57:58.258746+00 |
| description | A minimalist hosts-based tool for managing block lists and ad-blocking. |
| homepage | |
| repository | https://github.com/OliverBrotchie/block-list |
| max_upload_size | |
| id | 414639 |
| size | 46,736 |
A minimalist hosts-based tool for managing block lists and ad-blocking.
This project uses the excellent and regularly updated Unified Hosts lists from Steven Black.
Using Cargo (Rust)
cargo install block-list
More options will come in future!
Just use 'hosts' as the desired list if you only want ad-blocking.
sudo block-list /path/to/hosts your-desired-list
Basic usage:
sudo block-list /etc/hosts social
Pipe in a custom list:
cat someFile.txt | sudo block-list /etc/hosts
OR
cat someFile.txt | sudo block-list /etc/hosts social
Automatically update Block List at 10pm:
Open the root user's crontab file
sudo crontab -e
Then add the following line
0 22 * * * block-list /etc/hosts hosts
Use Block List to re-route a url to a different address:
Find the address using dig
dig duckduckgo.com
Coppy the IP address listed in 'Answer Section' to a file
# A custom Block List
# Re-route all requests from Google to DuckDuckGo
52.142.124.215 www.google.com
52.142.124.215 google.com
Pipe in the custom list to Block List
cat someFile.txt | sudo block-list /etc/hosts
If successful, this command will append a new list or replace the current list at the tail of the supplied hosts file, eg:
Block List updated! 🔒
##
# Host Database
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Your list of addresses
1.2.3.4 somehost
...
# Block List
0.0.0.0 some.custom.address.net
0.0.0.0 another.custom.address.xyz
0.0.0.0 some.malware.address.com
0.0.0.0 another.blocked.address.xxx