All Projects → babolivier → go-doh-client

babolivier / go-doh-client

Licence: GPL-3.0 license
A DNS over HTTPS client implementation written in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-doh-client

dns-resolver-infra
Privacy DNS infrastructure
Stars: ✭ 39 (-13.33%)
Mutual labels:  dns-over-https, doh
DNS-over-Discord
A 1.1.1.1 DNS resolver built for Discord
Stars: ✭ 228 (+406.67%)
Mutual labels:  dns-over-https, doh
q
A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.
Stars: ✭ 453 (+906.67%)
Mutual labels:  dns-over-https, doh
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (-22.22%)
Mutual labels:  dns-over-https, doh
dnsredir
Yet another seems better forward/proxy plugin for CoreDNS
Stars: ✭ 58 (+28.89%)
Mutual labels:  dns-over-https, doh
Smartdns
A local DNS server to obtain the fastest website IP for the best Internet experience, 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验。
Stars: ✭ 4,333 (+9528.89%)
Mutual labels:  dns-over-https, doh
dnscrypt-proxy
dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.
Stars: ✭ 9,198 (+20340%)
Mutual labels:  dns-over-https, doh
DNS-over-HTTPS
An implementation of RFC 8484 - DNS Queries over HTTPS (DoH).
Stars: ✭ 27 (-40%)
Mutual labels:  dns-over-https, doh
luci-app-dnscrypt-proxy2
LuCI support for dnscrypt-proxy version2 https://github.com/DNSCrypt/dnscrypt-proxy
Stars: ✭ 25 (-44.44%)
Mutual labels:  dns-over-https, doh
ansible-cloudflared
Install cloudflared and systemd service for DNS-Over-HTTPS
Stars: ✭ 18 (-60%)
Mutual labels:  dns-over-https, doh
dohjs
DNS over HTTPS client for use in the browser
Stars: ✭ 71 (+57.78%)
Mutual labels:  dns-over-https, doh
AdGuard-WireGuard-Unbound-Cloudflare
The Ultimate Network Security Guide 🔒 Protection | 🔎 Privacy | 🚀 Performance on home network 24/7 🕛 Accessible anywhere 🌏
Stars: ✭ 160 (+255.56%)
Mutual labels:  dns-over-https
greentunnel4jvm
Green Tunnel Alternative for JVM Languages
Stars: ✭ 15 (-66.67%)
Mutual labels:  dns-over-https
bebasdns
Membantumu berselancar dengan aman dan tidak terbatas!.
Stars: ✭ 56 (+24.44%)
Mutual labels:  dns-over-https
dnsd
DNS-over-HTTPS
Stars: ✭ 23 (-48.89%)
Mutual labels:  dns-over-https
gochinadns
Project archived: I believe Clash has provides a more elegant DNS & proxy solution. So there is no need to maintain this project. Have fun guys! ----- A drop-in replacement for ChinaDNS, with a better code implementation and several bugfixes.
Stars: ✭ 38 (-15.56%)
Mutual labels:  dns-over-https
trustydns
DNS Over HTTPS proxy, server and query programs
Stars: ✭ 22 (-51.11%)
Mutual labels:  dns-over-https
Dnspython
a powerful DNS toolkit for python
Stars: ✭ 1,838 (+3984.44%)
Mutual labels:  dns-over-https
dns.sb
https://dns.sb/
Stars: ✭ 32 (-28.89%)
Mutual labels:  dns-over-https
powerdns
PowerDNS dnsdist, recursor, authoritative, and admin interface. Supports DNSCrypt, DoH, and DoT.
Stars: ✭ 35 (-22.22%)
Mutual labels:  dns-over-https

go-doh-client

Build Status GoDoc Go Report Card codecov

This is a Go client library implementation of DNS over HTTPS (RFC8484).

Compliance with DNS specifications

This client library doesn't currently implement all of the DNS specifications.

It implements looking up the following records:

  • A
  • AAAA
  • CNAME
  • MX
  • NS
  • TXT
  • SRV
  • SOA
  • PTR

It also currently doesn't implement other query types than standard query, nor support for truncated messages. Full compliance, at least with RFC 1035, is something I'd like, though, so all of that should come in the future.

Usage

This client library should be as easy to use as any other DNS client library. The only difference is the transport layer it uses to perform lookups.

Here's a quick example:

package main

import (
	"log"

	"github.com/babolivier/go-doh-client"
)

func main() {
	resolver := doh.Resolver{
		Host:  "9.9.9.9", // Change this with your favourite DoH-compliant resolver.
		Class: doh.IN,
	}

	// Perform a A lookup on example.com
	a, _, err := resolver.LookupA("example.com")
	if err != nil {
		panic(err)
	}
	println(a[0].IP4) // 93.184.216.34

	// Perform a SRV lookup for e.g. a Matrix homeserver
	srv, _, err := resolver.LookupService("matrix", "tcp", "example.com")
	if err != nil {
		panic(err)
	}
	println(srv[0].Target) // matrix.example.com
}

Why?

I grew quite interested in how the Internet works lately, which implies spending some time reading DNS-related RFCs. On top of that, DNS over HTTPS is something I'm interested in quite a lot for privacy reasons and because of how harder it is to censor than classic DNS, so I decided to give it a go. And also because my definition of "having fun during holidays" obviously involves implementing part of the DNS RFC.

Contribute

Contributions are more than welcome. I tried to make this library as friendly to hack on as possible, especially when the said hack aims to implement support for a new DNS record type. Here's an example of how to do so, which is the exhaustive changeset for the implementation of SOA records.

And of course, if you have any issue or feedback you want to report on, feel free to open an issue.

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