You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
fangdingjun 6d2e6363dd use strings.TrimSpace to trim string 9 years ago
config_sample add sample config file 9 years ago
docs add mkdocs doc 9 years ago
testdata add function to parse /etc/hosts file 9 years ago
.gitignore Initial commit 9 years ago
LICENSE Initial commit 9 years ago
README.md Update README.md 9 years ago
arguments.go add function to parse /etc/hosts file 9 years ago
arguments_test.go add test case 9 years ago
hosts.go use strings.TrimSpace to trim string 9 years ago
hosts_test.go add function to parse /etc/hosts file 9 years ago
log.go 0.0.1 9 years ago
mkdocs.yml add mkdocs doc 9 years ago
parse.go remove newline on error 9 years ago
parse_test.go add test case 9 years ago
server.go add function to parse /etc/hosts file 9 years ago
server_test.go add test case 9 years ago
upstream.go 0.0.1 9 years ago
upstream_test.go add test case 9 years ago

README.md

gdns

a dns proxy server write by go

gdns much like dnsmasq or chinadns, but it can run on windows.

Features

support different domains use different upstream dns servers

support contact to the upstream dns server by tcp or udp

support blacklist list to block the fake ip

Install

# get the depended library
go get github.com/miekg/dns
go get github.com/vharitonsky/iniflags
    
git clone https://github.com/fangdingjun/gdns
cd gdns
go build
    
# generate a sample config file
./gdns -dumpflags > dns.ini
    
# edit the dns.ini and run, need root privileges to bind on port 53
sudo ./gdns -config dns.ini
    
# test it
dig @localhost twitter.com

Arguments

use gdns -h to show the command line arguments.

all arguments can specialed in config file or in command line.

there is a sample file in the config_sample/ directory.

Third-part library

use dns library to parse the dns message

use iniflags library to process the command line arguments and the config file