hb/README.md

33 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2019-02-23 18:08:32 +00:00
# HB
The Host Blocker command.
This is a system utility written in C that allows one to quickly black hole hosts in the /etc/hosts file, keeping one from resolving any DNS for those hosts and permanently blocking them on the system.
2020-01-14 19:37:12 +00:00
# How it Works
2020-01-18 12:38:32 +00:00
The program "blackholes" hosts by setting their entries in /etc/hosts to be
`0.0.0.0` so that when one tries to resolve the host in the browser the host will
resolve to `0.0.0.0`.
2020-01-14 19:37:12 +00:00
The program will wake up in a configurable timeframe continuously, reading a config file into memory and making appropriate changes to the /etc/hosts based on what it reads from the config.
2020-01-18 12:38:32 +00:00
Starting the program like this allows for the program to run as a daemon:
```bash
sudo hb -period <wakeup period> -config <path/to/config> -daemon
```
The config file at the moment is just a newline separated list of hosts that will
be added to the /etc/hosts file.
2019-02-23 18:08:32 +00:00
# Motivations
I would like to get better with C, and will be using C much more in the near future. In addition, I have issues with browsing to sites that hurt my productivity and am always on the command line.
# TODO
2020-01-18 12:38:32 +00:00
- Debug logging
- Systemd unit file for running as a daemon