All Projects → randomstuff → dnsfwd

randomstuff / dnsfwd

Licence: MIT License
DNS forwarder over a (TCP) virtual circuit

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to dnsfwd

Secureoperator
A DNS-protocol proxy for DNS-over-HTTPS providers, such as Google and Cloudflare
Stars: ✭ 241 (+1047.62%)
Mutual labels:  dns, dns-server
xip.name
Simple wildcard DNS inspired by xip.io
Stars: ✭ 143 (+580.95%)
Mutual labels:  dns, dns-server
fastdns
Fast DNS package for Go. Tuned for high performance. Zero memory allocations in almost paths. Up to 1M QPS on a single host.
Stars: ✭ 67 (+219.05%)
Mutual labels:  dns, dns-server
Pdns
PowerDNS Authoritative, PowerDNS Recursor, dnsdist
Stars: ✭ 2,575 (+12161.9%)
Mutual labels:  dns, dns-server
Alfis
Alternative Free Identity System
Stars: ✭ 162 (+671.43%)
Mutual labels:  dns, dns-server
Nativepayload dns
C# code for Transferring Backdoor Payloads by DNS Traffic and Bypassing Anti-viruses
Stars: ✭ 228 (+985.71%)
Mutual labels:  dns, dns-server
afdns
Ad free DNS server. A docker container with a DNS server configured to block advertisement hosts.
Stars: ✭ 27 (+28.57%)
Mutual labels:  dns, dns-server
Pihole Unbound
Guide to setup Unbound recursive DNS resolver with Pi-Hole. With additional configs for speed and security!! 🚀🔒
Stars: ✭ 165 (+685.71%)
Mutual labels:  dns, dns-server
AmpliSpy
Check local or remote list of DNS servers for suitability in DNS Amplification DoS.
Stars: ✭ 39 (+85.71%)
Mutual labels:  dns, dns-server
newdns
A library for building custom DNS servers in Go.
Stars: ✭ 40 (+90.48%)
Mutual labels:  dns, dns-server
Bind9
Mirror of https://gitlab.isc.org/isc-projects/bind9, please submit issues and PR/MRs in the GitLab.
Stars: ✭ 197 (+838.1%)
Mutual labels:  dns, dns-server
zonemanager
Central DNS/DHCP database with replication to Amazon Route53, BIND, MikroTik routers and other services.
Stars: ✭ 29 (+38.1%)
Mutual labels:  dns, dns-server
Dcompass
[WIP] High-performance programmable DNS server aiming at robustness, speed, and flexibility
Stars: ✭ 174 (+728.57%)
Mutual labels:  dns, dns-server
Blahdns
A small hobby ads block dns project with doh, dot, dnscrypt support.
Stars: ✭ 228 (+985.71%)
Mutual labels:  dns, dns-server
Dnsguide
A guide to writing a DNS Server from scratch in Rust
Stars: ✭ 2,226 (+10500%)
Mutual labels:  dns, dns-server
docker-nxfilter
🐳 Run NxFilter in Docker!
Stars: ✭ 28 (+33.33%)
Mutual labels:  dns, dns-server
Unbound Docker
Unbound DNS Server Docker Image
Stars: ✭ 147 (+600%)
Mutual labels:  dns, dns-server
Routedns
DNS stub resolver, proxy and router with support for DoT, DoH, DoQ, and DTLS
Stars: ✭ 153 (+628.57%)
Mutual labels:  dns, dns-server
unbound-dns-firewall
DNS-Firewall Python script for UNBOUND
Stars: ✭ 23 (+9.52%)
Mutual labels:  dns, dns-server
Windows.10.DNS.Block.List
Windows DNS Block List
Stars: ✭ 18 (-14.29%)
Mutual labels:  dns, dns-server

dnsfwd

LEGACY: See DNS Privacy for up-to-date solutions.

DNS forwarder over a (TCP) virtual circuit:

  • open UDP sockets and wait for incoming queries;

  • forwards the queries to a given TCP endpoint using a persistent TCP connection (instead of using one TCP connection per request).

This can be used to use DNS/TLS. Unbound can delegate requests to a remote DNS/TLS server but each request uses a new TCP connection which is not very efficient.

Warning: This is a prototype. You might not want to use it in production. Use at your own risk. You might want to use it in some restricted environment. The systemd unit file includes many restrictions and does not run as root. The program by itself currently cannot drop privileges: it must either run as root or bind to a non privileged port.

DNS/TLS setup

Basic setup

dnsfwd --bind-udp 127.0.0.1:53 --connect-tcp 127.0.0.1:53
                                                 .------------------.
.---------------.              .---------.       | Remote           |
| Stub resolver |------------->| stunnel |------>| recursive server |
'---------------' DNS/TCP 53   '---------'       '------------------'
        |                           ^ DNS/TLS/TCP 443
        |                           |
        |         .---------.       |
        '-------->| dnsfwd  |-------'
       DNS/UDP 53 '---------' DNS/TCP 53

This is an overview of how this can be used to implement communicate with a remote recursive DNS server over TLS:

  1. Find a remote DNS recursive server working over TLS.

    Unbound can serve natively over TLS. Otherwise, a stunnel instance can be used on the remote side to terminate the TLS encapsulation.

    The port TCP 443 is a good choice for this service as it will usually be open on most networks and will look like a normal HTTP/TLS traffic.

  2. Setup a local stunnel instance listening on TCP 53 and initiating the TLS encapsulation with the remote server.

    This provides a local DNS/TCP service forwarding the requests over TLS to the remote recursive server: each TCP connection to the local service will create a new TLS/TCP connection to the remote server.

  3. Setup a local dnsfwd instance listening on UDP 53 and connecting to the local stunnel instance.

    This provides a local DNS/UDP service forwarding the requests over TLS to the remote recursive server: the requests are multiplexes over a persistent TCP connection.

  4. Point your stub resolver to this remote service:

    • it will send queries to the local DNS/UDP dnsfwd server;

    • if the query is truncated, it will send the query to the local DNS/TCP stunnel server.

Possible evolutions

  • native TLS support

    A stunnel instance would not be necessary. However, by using a separate TLS encapsulation daemon, the user can choose a suitable DNS implementation. The native TLS implementation would probably be tied to a given TLS implementation.

  • DNS/TCP support on the server-side

    Each local DNS/TCP connection creates a DNS/TLS connection to the remote server. By implementing server-side DNS/TCP support in dnsfwd, we could multiplex the requests made over local DNS/TCP over persistent TCP connections as it is currently done with local DNS/UDP.

  • multiplexing over multiple TCP (or TLS) connections with the remote server

Advanced setup

For better performance, a local caching DNS server can be used between the stub resolver and stunnel+dnsfwd:

  1. move stunnel and dnsfwd to another port;

  2. setup a local caching DNS server forwarding all requests to the local stunnel+dnsfwd pair (unbound can do this).

TODO

  • connect to UNIX socket;
  • load balancing on multiple servers;
  • truncation of the answer (EDNS0, MTU);
  • logging (syslog, stderr logging);
  • check the QR bit;
  • forget old messages;
  • limit the number of requests in queue;
  • limit the number of submitted requests;
  • mux the requests over multiple VC;
  • native TLS VC;
  • PF_INET support (?);
  • async_connect.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].