/dnsserver

Simple DNS proxy based on CoreDNS

Primary LanguageGo

dnsserver

Docker Pulls

dnsserver is DNS proxy based on CoreDNS. It forward the DNS request to different upstream by the rules. The rules are powered by the geosite data from V2Ray.

Usage

The format of dnsserver config file is the based on Corefile, but with v2router plugin enabled and some other essential plugins:

  • cancel
  • bind
  • prometheus
  • errors
  • cache

Here is an example config for v2router plugin:

    # v2router [path of geosite.dat]
	v2router geosite.dat {
        # reject all ads domain
		reject geosite:category-ads-all

        # forward some category of domains to a list of upstream
        # 2 attributes available
	    # `retry`
	    # `timeout`
        # Only DNS over TCP/UDP is supported now.
		forward geosite:geolocation-!cn to tcp://1.1.1.1:53;tcp://8.8.8.8:53 retry:10 timeout:800ms
		forward geosite:cn to udp://114.114.114.114:53;udp://119.29.29.29:53

        # default route.
		default tcp://1.1.1.1:53;tcp://8.8.8.8:53 timeout:800ms retry:10
	}

These is also a Grafana panel available in metrics/grafana/dnsserver.json.