Skip to content

ninjamar/compactdns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CompactDNS (CDNS)

CompactDNS, also known as CDNS is a authoritative and forwarding DNS server.

Features

  • Easy to setup
  • Can be configured as an adblocker
  • Caches responses locally

Installation

Install CDNS from source

git clone https://github.com/ninjamar/compactdns
cd compactdns
pip install .

For development,

pip install -e .

Usage

After installation, CDNS can be used by running:

cdns [command] [options]

Commands

run

Starts the DNS server.

cdns run [options]

Configuration is stored in a toml or json file. See config.toml for an example configuration.

cdns run --config config.toml

shell

cdns shell [options]

Options: --host, -h: The host address of the shell server in the format of a.b.c.d:port --secret, s: The secret of the shell server. The secret is logged when cdns is started.

TLS

A key and certificate file is needed to use TLS. Generate it:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes

Interactive shell

For debugging, CDNS includes an interactive python shell. The shell can be accessed using the shell command.

>>> help(self.command)
>>> help(cdns.manager.ServerManager.command)

DNS Zones

DNS zones can be stored in a folder. Make sure that each filename is in the format of domain.zone.

Changing the DNS server

On MacOS:

networksetup -setdnsservers Wi-Fi A.B.C.D

DNS runs over port 53 for both UDP and TCP.

Testing

Send test queries using dig.

dig @A.B.C.D -p PORT google.com

License

This project is licensed under the MIT License. Please see the LICENSE file for more details.

Releases

No releases published

Packages

No packages published

Languages