Switch branches/tags
Nothing to show
Clone or download


DNS reverse proxy

Build Status Godoc

A DNS reverse proxy to route queries to different DNS servers. To illustrate, imagine an HTTP reverse proxy but for DNS.

It listens on both TCP/UDP IPv4/IPv6 on specified port. Since the upstream servers will not see the real client IPs but the proxy, you can specify a list of IPs allowed to transfer (AXFR/IXFR).


$ go run dns_reverse_proxy.go -address :53 \
    -default \
    -route .example.com.= \

A query for example.net or example.com will go to, the default. However, a query for subdomain.example.com will go to


Install go package, create Debian package, install:

$ go get -u github.com/miekg/dns
$ go get -u github.com/StalkR/dns-reverse-proxy
$ cd $GOPATH/src/github.com/StalkR/dns-reverse-proxy
$ fakeroot debian/rules clean binary
$ sudo dpkg -i ../dns-reverse-proxy_1-1_amd64.deb

Configure in /etc/default/dns-reverse-proxy and start with /etc/init.d/dns-reverse-proxy start.


Apache License, version 2.0.


Bugs, feature requests, questions

Create a new issue.