Skip to main content

A lightweight yet useful proxy DNS server

Project description

https://badge.fury.io/py/simpledns.png

A lightweight yet useful proxy DNS server designed to cope with complicated Internet environment in China, inspired by ChinaDNS , dnsmasq-chinadns and fqdns.

Install

  • Linux/Mac OS X:

    $ pip install simpledns
  • Windows

    Download

Usage

Run sudo simpledns on your local machine. Then set your DNS server to 127.0.0.1.

$ dig www.twitter.com +short
twitter.com.
199.59.149.230
199.59.148.10
199.59.150.7
199.59.150.39

Advanced

$ simpledns -h
usage: simpledns [-h] [-b BIND_ADDR] [-p BIND_PORT]
                 [--upstream-ip UPSTREAM_IP] [--upstream-port UPSTREAM_PORT]
                 [--query-timeout QUERY_TIMEOUT] [--min-ttl MIN_TTL]
                 [--max-ttl MAX_TTL] [--cache-size CACHE_SIZE] [-t]
                 [--hosts-file HOSTS_FILE] [--dispatch-conf DISPATCH_CONF]
                 [-v {0,1,2}] [-q] [-V]

A lightweight yet useful proxy DNS server

optional arguments:
  -h, --help            show this help message and exit
  -b BIND_ADDR, --bind-addr BIND_ADDR
                        local address to listen
  -p BIND_PORT, --bind-port BIND_PORT
                        local port to listen
  --upstream-ip UPSTREAM_IP
                        upstream DNS server ip address
  --upstream-port UPSTREAM_PORT
                        upstream DNS server port
  --query-timeout QUERY_TIMEOUT
                        time before close port used for querying
  --min-ttl MIN_TTL     the minimum time a record is held in cache
  --max-ttl MAX_TTL     the maximum time a record is held in cache
  --cache-size CACHE_SIZE
                        record cache size
  -t, --tcp-server      enables TCP serving
  --hosts-file HOSTS_FILE
                        hosts file
  --dispatch-conf DISPATCH_CONF
                        URL dispatch conf file
  -v {0,1,2}, --verbosity {0,1,2}
                        output verbosity
  -q, --quiet           disable output
  -V, --version         print version number and exit

Configuration

Configuration file is /usr/local/etc/simpledns/dispatch.conf.

Dispatch conf file uses the same rule as in Dnsmasq. ‘Address’ and ‘Server’ rules are supported.

address=/example1.com/1.1.1.1
server=/example2.com/1.1.1.2

Default dispatch conf file is from dnsmasq-china-list.

License

The MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpledns-0.1.2.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file simpledns-0.1.2.tar.gz.

File metadata

  • Download URL: simpledns-0.1.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for simpledns-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5fe4b1581651dc8712afadb53c254969266eaee15cc9c7e2dedb51ef1cae77bc
MD5 683bbe44cd640c198b735737460edfb2
BLAKE2b-256 431eeb87bf0c3ea80fc129d017b6360f37fd1ee57c3c4073de1482650ff438b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page