Giter Club home page Giter Club logo

dot-proxy's Introduction

dot-proxy

A DNS over TLS proxy written in python

N26 SRE Challenge

DNS to DNS-over-TLS proxy

I was recently asked if I could write a DNS proxy, receiving TCP or UDP DNS traffic I was able to run sockets in a thread and listen to multiple requests and proxy them to Cloudflare's DNS over TLS offering.

I had to write 2 scripts, one for UDP and one for TCP, then run each as a supervisor process. This then runs inside a docker container

Testing

run the docker script:

./docker.sh

Now you should have a running container listening on 53 and 53/udp, you can connect with:

docker exec -it dot-proxy /bin/bash

Then tail the logs with:

tail -f /var/log/supervisor/*

And test it by running (assuming the IP address is right):

dig google.com -t A @172.17.0.2 dig google.com -t A @172.17.0.2 +tcp

I also tested the threading works, I did this by running tcpdump:

tcpdump -i docker0 -vvv -w docker.pcap

I then opened a tmux session and made 4 requests at once (I did TCP first, then UDP), in the PCAP I could see each request being received and acknowledged (TCP), then the DNS over TLS requests run, then finally all of the responses go back to the requester. Since this all happens in ~0.15s for TCP and ~0.14s for UDP it would be difficult to confirm this is running in parallel otherwise.

dot-proxy's People

Contributors

rumbles avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.