Python script designed to fetch domains from a list and add them to /etc/hosts
- Install the python requests module
pip install requests
or
pip3 install requests
-
Add more lists in
adlists.list
(Optional) -
Run the script
./get_adblock.py
or
python get_adblock.py
- Copy the newly created file to
/etc/hosts
NOTE: This script makes a backup of your current /etc/hosts
in hosts.bak
- Flush your DNS cache
This can be done in numerous ways, just search on your search engine of choice:
how to flush the dns cache on [OS or distro name here]