Cookie Engineer's Website

DNS Proxy

DNS Proxy Teaser

Overview

The DNS Proxy allows to tunnel DNS requests via a SOC KS proxy (e.g. a local TOR proxy daemon), and it randomizes the incoming DNS requests with a Ronin mechanism if the resolv.conf contains more than one configured DNS nameserver .

I started a fork as the current maintainer from @jtripper due to inactivity in 2018, with the goal of the fork being to stay compatible with upstream for an eventual merge.

Usage

The daemon must be run as root in order to bind to port 53 for local DNS requests.

Usage: dns-proxy [options]

With no parameters, the configuration file is read from 'dns-proxy.conf'.

* -n          -- No configuration file (socks: 127.0.0.1:9050, listener: 0.0.0.0:53).
* -h          -- Print this message and exit.
* config_file -- Read from specified configuration file.

Examples:

 dns-proxy -n;
 dns-proxy /path/to/dns-proxy.conf;
						

Configuration

The configuration file format may contain any of the below lines, whereas the defaults are incrementally overwritten with the values given in the custom dns-proxy.conf file.

Chunks or lines that start with # are ignored and not interpreted, so you can use them to comment your settings.

socks_addr           = 127.0.0.1   # socks listener address
socks_port           = 9050        # socks listener port
listen_addr          = 0.0.0.0     # address for the dns proxy to listen on
listen_port          = 53          # port for the dns proxy to listen on (most cases 53)
set_user             = nobody      # username to drop to after binding
set_group            = nobody      # group to drop to after binding
resolv_conf          = resolv.conf # location of resolv.conf file to read from
rewrite_resolve_conf = false       # toggles whether or not to rewrite resolv.conf
log_file             = /dev/null   # location to log to (should be /dev/null unless debugging).
						

Installation

git clone "https://github.com/cookiengineer/dns-proxy.git";
cd ./dns-proxy;

make;

sudo cp ./dns-proxy /usr/sbin/dns-proxy;
sudo chmod +x /usr/sbin/dns-proxy;
						

After running the daemon, the system should be configured to use the proxy automatically if the rewrite_resolv_conf flag was set to true .