All Projects → cherrot → gochinadns

cherrot / gochinadns

Licence: MIT license
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.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gochinadns

dns-server-setup
Ansible playbook to easily deploy new, fully configured, DNS servers.
Stars: ✭ 48 (+26.32%)
Mutual labels:  dns-server, dns-over-https
DNS-over-HTTPS
An implementation of RFC 8484 - DNS Queries over HTTPS (DoH).
Stars: ✭ 27 (-28.95%)
Mutual labels:  dns-server, dns-over-https
updns
DNS proxy tool
Stars: ✭ 58 (+52.63%)
Mutual labels:  dns-server, dns-proxy
dnsd
DNS-over-HTTPS
Stars: ✭ 23 (-39.47%)
Mutual labels:  dns-over-https, dns-proxy
Smartdns
A local DNS server to obtain the fastest website IP for the best Internet experience, 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验。
Stars: ✭ 4,333 (+11302.63%)
Mutual labels:  dns-server, dns-over-https
zerotierDNS
Dns-server for zerotier networks. Resolves names of clients to their IP
Stars: ✭ 23 (-39.47%)
Mutual labels:  dns-server, dns-proxy
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (-7.89%)
Mutual labels:  dns-server, dns-over-https
Netflix Proxy
Smart DNS proxy to watch Netflix
Stars: ✭ 3,220 (+8373.68%)
Mutual labels:  dns-server, dns-proxy
prc-dns
对CDN友好的DNS服务器,区分国内外流量的必备工具。
Stars: ✭ 47 (+23.68%)
Mutual labels:  dns-server, dns-over-https
dcompass
A high-performance programmable DNS component aiming at robustness, speed, and flexibility
Stars: ✭ 260 (+584.21%)
Mutual labels:  dns-server, dns-over-https
mosdns-cn
A simple DNS forwarder that can make life easier.
Stars: ✭ 254 (+568.42%)
Mutual labels:  chinadns, dns-over-https
jp.tiar.app
jp.tiar.app
Stars: ✭ 28 (-26.32%)
Mutual labels:  dns-over-https
doh-cf-workers
DNS-over-HTTPS proxy on Cloudflare Workers
Stars: ✭ 103 (+171.05%)
Mutual labels:  dns-over-https
callsign
Small DNS service to support local development. Provides the functionality of cloud-based DNS services on your local machine, allowing automated deployment simulations on the desktop.
Stars: ✭ 42 (+10.53%)
Mutual labels:  dns-server
DoTH-DNS
Your server doth DNS the safe way if you use DoTH-DNS.
Stars: ✭ 26 (-31.58%)
Mutual labels:  dns-server
ruby-dns-mock
DNS mock server written on 💎 Ruby. Mimic any DNS records for your test environment with fake DNS server.
Stars: ✭ 50 (+31.58%)
Mutual labels:  dns-server
node-dns
🌐 DNS Server and Client Implementation in Pure JavaScript with no dependencies.
Stars: ✭ 390 (+926.32%)
Mutual labels:  dns-server
PyDDNS
Complete system to create your own server ddns
Stars: ✭ 57 (+50%)
Mutual labels:  dns-server
microdns
A tiny dockerized DNS server in Go that (almost) always returns the same IP for any query sent to it.
Stars: ✭ 52 (+36.84%)
Mutual labels:  dns-server
DoNotSend
Sending messages by hacking the DNS protocol. See website for demo server usage instructions
Stars: ✭ 93 (+144.74%)
Mutual labels:  dns-server

GoChinaDNS

GoChinaDNS is a DNS proxy, which smartly dispatches DNS questions to get nearest answers. This can be a drop-in replacement for ChinaDNS, with a better code implementation and several bugfixes.

Install

Binaries for linux, windows and darwin (macOS) are available under Releases.

You will also need a list of IP ranges in China, such as @pexcn/chnroute.txt.

Build

This project is written in Go. If you want to build it yourself, you need to install Go first.

git clone https://github.com/cherrot/gochinadns
cd gochinadns
go get -u ./...
cd cmd/chinadns
go build

Usage

Run:

./chinadns -p 5553 -c ./chnroute.txt -v

Test:

dig @::1 -p5553 google.com

Advanced usage

Customize upstream servers

./chinadns -p 5553 -c ./chnroute.txt -s 114.114.114.114,127.0.0.1:5353

In this example, 127.0.0.1:5353 is the trusted resolver and can be a local dns forwarder (e.g. dnscrypt-proxy).

Note: you still need to make sure that your trusted upstream resolver is accessible through a secure channel otherwise your DNS will still get poisoned.

Specify resolver protocol

The default format for upstream resolvers is ip:port for backwards compatibility with ChinaDNS. Resolvers can also be passed as protocol[+protocol]@ip:port where protocol is udp or tcp. Protocols are dialed in the order they are written (left to right). The rightmost protocol acts as a fallback and will only be dialed if the leftmost fails.

For example, if the upstream resolver is a local dns forwarder on port 5353, it can be passed as [email protected]:5353 because fallback to TCP is not necessary.

Similarly, if you run a transparent TCP proxy that proxies traffic to 8.8.8.8 you could use [email protected]:

./chinadns -p 5553 -c ./china.list -s [email protected],[email protected]:5353,[email protected]

Params

$ ./chinadns -h

Usage of chinadns:
  -V    Print version and exit.
  -b string
        Bind address. (default "::")
  -c string
        Path to China route list. Both IPv4 and IPv6 are supported. See http://ipverse.net (default "./china.list")
  -d    Drop results of trusted servers which containing IPs in China. (Bidirectional mode.) (default true)
  -domain-blacklist string
        Path to domain blacklist file.
  -domain-polluted string
        Path to polluted domains list. Queries of these domains will not be sent to DNS in China.
  -force-tcp
        Force DNS queries use TCP only. Only applies to resolvers declared in ip:port format.
  -l string
        Path to IP blacklist file.
  -m    Enable compression pointer mutation in DNS queries.
  -p int
        Listening port. (default 53)
  -reuse-port
        Enable SO_REUSEPORT to gain some performance optimization. Need Linux>=3.9 (default true)
  -s value
        Comma separated list of upstream DNS servers. Need China route list to check whether it's a trusted server or not.
        Servers can be in format ip:port or protocol[+protocol]@ip:port where protocol is udp or tcp.
        Protocols are dialed in order left to right. Rightmost protocol will only be dialed if the leftmost fails.
        Protocols will override force-tcp flag. If empty, protocol defaults to udp+tcp (tcp if force-tcp is set) and port defaults to 53.
        Examples: [email protected],[email protected]:5353,1.1.1.1 (default [email protected],[email protected])
  -test-domains string
        Domain names to test DNS connection health. (default "qq.com,163.com")
  -timeout duration
        DNS request timeout (default 1s)
  -trusted-servers value
        Comma separated list of servers which (located in China but) can be trusted.
        Uses the same format as -s.
  -udp-max-bytes int
        Default DNS max message size on UDP. (default 4096)
  -v    Enable verbose logging.
  -y float
        Delay (in seconds) to query another DNS server when no reply received. (default 0.1)

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