Reroutes DNS requests to block unwanted content
 
 
Go to file
Justin Reichardt ee0467375f Removed Windows install instructions
I don't know what I was thinking, if it doesn't work then why did I include it...
2022-09-19 17:01:52 -05:00
src Forgot to add the default config file... 2022-06-13 22:08:23 -05:00
.gitignore Ignore the configre.go file when building 2022-06-17 14:58:15 -05:00
COPYING Improved the the Copyright 2021-08-28 13:59:33 -05:00
Makefile Removed extranious "/" in Makefile 2022-06-17 14:57:03 -05:00
README.md Removed Windows install instructions 2022-09-19 17:01:52 -05:00
VERSION Changed version and Readme and updated version to 0.2 2022-06-13 09:02:01 -05:00

README.md

rhosts

This reroutes urls to 0.0.0.0 and ::1 in order to block them from being reached. This is useful for blocking different types of content.

How to Install

Linux

Build Dependencies:

  • make
  • golang

Linux/Systemd:

make install

Build for Windows on Linux:

make build-win

How to use

Configuring

Open the config file:

Linux: /etc/rhosts/rhosts.cfg
Windows: \ProgramData\rhosts\rhosts.cfg

There are 3 types of entries: download, site, and whitelist. Downloads are downloaded and stripped of comments and bad entries if possible before being added to a list of sites. Whitelisted urls are removed from the list of sites. From there all the urls are added to the hosts file for both IPv4 and IPv6. You can also add comments by prepending with a '#'.

Example:

# This is a static entry
site=www.site.xyz
# This is a download entry
download=w3.site.xyz/location/to/config.txt
# This is a whitelist entry
whitelist=www.site.xyz

Running

Easiest thing is to just run the command rhosts

If enabling as a service with systemd:

systemctl enable rhosts.service

You can also run it using Systemd:

systemctl start rhosts.service

Flags

  • --version

Displays version information

  • -d

Runs in daemon mode, refreshing every 24hrs (1440 minutes**

  • -t

Changes the daemon refresh time

  • --removetimestamp

Removes the timestamp on the log so it doesn't interfere with other log systems such as Systemd