All Projects → ns1labs → doq-proxy

ns1labs / doq-proxy

Licence: Apache-2.0 license
DNS-over-QUIC to UDP Proxy

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to doq-proxy

gost
GO Simple Tunnel - a simple tunnel written in golang
Stars: ✭ 8,395 (+14628.07%)
Mutual labels:  dns, udp, quic
http-connection-lifecycle
Complete and detailed explanation of HTTP connection lifecycle
Stars: ✭ 43 (-24.56%)
Mutual labels:  dns, udp
gost
GO Simple Tunnel - a simple tunnel written in golang
Stars: ✭ 154 (+170.18%)
Mutual labels:  dns, quic
Nps
一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.
Stars: ✭ 19,537 (+34175.44%)
Mutual labels:  dns, udp
Reactor Netty
TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
Stars: ✭ 1,743 (+2957.89%)
Mutual labels:  udp, quic
Quic.net
A .NET C# Implementation of QUIC protocol - Google's experimental transport layer.
Stars: ✭ 173 (+203.51%)
Mutual labels:  udp, quic
EdgeAdmin
CDN & WAF集群管理系统。
Stars: ✭ 199 (+249.12%)
Mutual labels:  dns, udp
load-balancers
In-progress version of draft-ietf-quic-load-balancers
Stars: ✭ 31 (-45.61%)
Mutual labels:  ietf, quic
Dnsguide
A guide to writing a DNS Server from scratch in Rust
Stars: ✭ 2,226 (+3805.26%)
Mutual labels:  dns, udp
Libnet
A portable framework for low-level network packet construction
Stars: ✭ 640 (+1022.81%)
Mutual labels:  dns, udp
Kcp
⚡ KCP - A Fast and Reliable ARQ Protocol
Stars: ✭ 10,473 (+18273.68%)
Mutual labels:  udp, quic
quic-py
QUIC protocol implementation in python
Stars: ✭ 38 (-33.33%)
Mutual labels:  udp, quic
Warpcore
User-space UDP/IP stack on top of netmap
Stars: ✭ 67 (+17.54%)
Mutual labels:  udp, quic
ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (+12.28%)
Mutual labels:  dns, udp
Lsquic
LiteSpeed QUIC and HTTP/3 Library
Stars: ✭ 727 (+1175.44%)
Mutual labels:  udp, quic
Ngtcp2
ngtcp2 project is an effort to implement IETF QUIC protocol
Stars: ✭ 589 (+933.33%)
Mutual labels:  udp, quic
qlog
The IETF I-D documents for the qlog format
Stars: ✭ 36 (-36.84%)
Mutual labels:  ietf, quic
mocket
Reliable UDP server client for flaky networks
Stars: ✭ 21 (-63.16%)
Mutual labels:  udp, quic
Pyexfil
A Python Package for Data Exfiltration
Stars: ✭ 554 (+871.93%)
Mutual labels:  dns, quic
datagram
In-progress version of draft-ietf-quic-datagram
Stars: ✭ 25 (-56.14%)
Mutual labels:  ietf, quic

DNS-over-QUIC to UDP Proxy

DNS-over-QUIC to UDP proxy and client implementation.

2019—2022 © NSONE, Inc.

License

This code is released under Apache License 2.0. You can find terms and conditions in the LICENSE file.

Protocol compatibility

The DNS-over-QUIC implementation follows draft-ietf-dprive-dnsoquic-11.

The QUIC protocol compatibility depends on the quic-go library.

Getting started

Build the DoQ proxy and testing client.

go build ./cmd/proxy
go build ./cmd/client

Generate testing key and self-signed certificate for the proxy server.

openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve -out key.pem
openssl req -x509 -days 30 -subj "/CN=DNS-over-QUIC Test" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1,IP:::1" -key key.pem -out cert.pem

Start the proxy. By default, the server loads the TLS key and certificate from the files generated above, will use 8.8.4.4 (Google Public DNS) as a backend server, and will listen on UDP port 853 (experimental port from the draft). Use command line options to modify the default behavior. Notice the use of the default port requires starting the proxy as superuser.

sudo ./proxy

Query the proxy using the testing utility. The client establishes a QUIC session to the server and sends each query via a dedicated stream. Upstream, the XFR requests are sent over TCP, all others are sent over UDP. The replies are printed in the order of completion:

./client ns1.com A ns1.com AAAA
;; opcode: QUERY, status: NOERROR, id: 25849
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;ns1.com.	IN	 AAAA

;; ANSWER SECTION:
ns1.com.	195	IN	AAAA	2606:4700:10::6814:31b6
ns1.com.	195	IN	AAAA	2606:4700:10::6814:30b6
ns1.com.	195	IN	RRSIG	AAAA 13 2 200 20190325121641 20190323121641 44688 ns1.com. m17G7sGkXNhBiKINI2LuQLvUL0Qb+l6LMUmKSoVo2TP5sw3Yd27L44QOZhVU1GS//tD1e6YVOVsMrW3arlk/bQ==

;; ADDITIONAL SECTION:

;; OPT PSEUDOSECTION:
; EDNS: version 0; flags: do; udp: 512

;; opcode: QUERY, status: NOERROR, id: 26044
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;ns1.com.	IN	 A

;; ANSWER SECTION:
ns1.com.	25	IN	A	104.20.49.182
ns1.com.	25	IN	A	104.20.48.182
ns1.com.	25	IN	RRSIG	A 13 2 26 20190325121645 20190323121645 44688 ns1.com. xJK5DhMiFqxWx/gC7gHQXM8wkVFDyocIF3Zuehqa+S92zAq3yOtZMrqVRXxsKNw2lfCMQXLHr7hVUDm5H4B5eA==

;; ADDITIONAL SECTION:

;; OPT PSEUDOSECTION:
; EDNS: version 0; flags: do; udp: 512

Troubleshooting

Note that this is an experimental code built on top of an experimental protocol.

The server and client in this repository use the same QUIC library and therefore they should be compatible. However, if a different client is used, the handshake may fail on the version negotiation. We suggest to check packet capture first when the client is unable to connect.

The proxy also logs information about accepted connections and streams which can be used to inspect the sequence of events:

$ sudo ./proxy -listen 127.0.0.1:853 -cert cert.pem -key key.pem -backend 8.8.4.4:53
ts=2019-03-24T10:31:32.408891Z msg="listening for clients" addr=127.0.0.1:853
ts=2019-03-24T12:16:45.048583Z client=127.0.0.1:52212 msg="session accepted"
ts=2019-03-24T12:16:45.050231Z client=127.0.0.1:52212 stream_id=0 msg="stream accepted"
ts=2019-03-24T12:16:45.050278Z client=127.0.0.1:52212 stream_id=4 msg="stream accepted"
ts=2019-03-24T12:16:45.091568Z client=127.0.0.1:52212 stream_id=4 msg="stream closed"
ts=2019-03-24T12:16:45.104623Z client=127.0.0.1:52212 stream_id=0 msg="stream closed"
ts=2019-03-24T12:16:45.110261Z client=127.0.0.1:52212 msg="session closed"

Contributing

This project is maintained.

Pull Requests and issues are welcome. See the NS1 Contribution Guidelines for more information.

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].