Skip to content

vlopatkin/go-dns-proxy

 
 

Repository files navigation

DNS Proxy

A simple DNS proxy written in go based on github.com/miekg/dns

CircleCI Docker Build

How to use it

Docker

$ docker run -p 53:53/udp vlopatkin/go-dns-proxy:latest -use-outbound -json-config='{
    "default_dns": "8.8.8.8:53",
    "servers": {
        "google.com" : "8.8.8.8:53"
    },
    "domains": {
        "**.test.com" : "127.0.0.1"
    }
}'

Download executables

Download

Go get

$ go get github.com/vlopatkin/go-dns-proxy
$ go-dns-proxy -use-outbound -json-config='{
    "default_dns": "8.8.8.8:53",
    "servers": {
        "google.com" : "8.8.8.8:53"
    },
    "domains": {
        "**.test.com" : "127.0.0.1"
    }
}'

Arguments

  -expiration int
    	cache expiration time in seconds (default -1)
  -file string
    	config filename (default "config.json")
  -json-config string
    	config in json format
  -log-level string
    	log level, accepts err, info, none (default "info")
  -port int
    	UDP port, use with use-outbound flag (default 53)
  -use-outbound
    	use outbound address of the host for incoming connections

Config file format

{
    "host": "localhost:35353",
    "default_dns": "8.8.8.8:53",
    "servers": {
        "google.com" : "8.8.8.8:53"
    },
    "domains": {
        "**.test.com" : "127.0.0.1"
    }
}

About

A simple DNS proxy in go

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.8%
  • Dockerfile 2.2%