hostsctl

:see_no_evil: Control your /etc/hosts file easily, block ads, social networks, and more.

:no_entry_sign: hostsctl

Hostsctl.sh allows you to control your /etc/hosts easily. you can block ads, porn, social networks with one command.

screenshot

Original hostsctl original

Installation

To install it right away, type:

  sudo curl -L https://git.io/vy5xx -o /usr/local/bin/hostsctl
  sudo chmod +x /usr/local/bin/hostsctl

or download hostsctl.sh and run it.

Bash-completions

If you want bash-completions for hostsctl.

  • Linux (Archlinux)
  sudo cp hostsctl.bash-completion /usr/share/bash-completion/completions/hostsctl

If you want to add your platform, please do so.

Usage

run:

  sudo hostsctl update

after the installation to update the hosts file.

  • Before you can start using hostsctl you need to select hosts file.

List of of hosts files

file by
hosts StevenBlack/hosts
hosts AdAway
hosts add.2o7Net
hosts add.Spam
hosts SpotifyAds
hosts UncheckyAds
  • Place the hosts file url in the URL variable in hostsctl.sh

and run hostsctl update to download the hosts file.

Examples

  sudo hostsctl enable  bigsite.tld # Now you have access to this site
  sudo hostsctl disable bigsite.tld # Now the site pointed to 0.0.0.0

See also --help

Contributing

Any collaboration is welcome!

Thanks

  • Steven Black hosts repo for inspiring me to create this.

License

gplv3