https://github.com/chennqqi/simpledns
simple dns server match zone by client ip
https://github.com/chennqqi/simpledns
consul dns docker forward go golang k8s match-ip ping proxy upstream zone
Last synced: about 1 month ago
JSON representation
simple dns server match zone by client ip
- Host: GitHub
- URL: https://github.com/chennqqi/simpledns
- Owner: chennqqi
- License: apache-2.0
- Created: 2019-03-22T10:03:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-29T09:53:34.000Z (over 5 years ago)
- Last Synced: 2025-02-10T11:15:01.812Z (over 1 year ago)
- Topics: consul, dns, docker, forward, go, golang, k8s, match-ip, ping, proxy, upstream, zone
- Language: Go
- Homepage:
- Size: 290 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/chennqqi/simpledns) [](https://godoc.org/github.com/chennqqi/simpledns) [](https://github.com/chennqqi/simpledns/blob/master/LICENSE) [](https://goreportcard.com/report/github.com/chennqqi/simpledns)
# simple dns server
a simple dns server

## feature
* consul based configure file
* standard zone file support
* dynamic load zone files
* client-ip(CIDR) based zone query
* outter dns server proxy with auto switch
* dns proxy with localcache, with this feature will enable proxy consul dns service to public
* multiple resolve with ping check
## build from source
required go version >= 1.10
go get -u -v github.com/chennqqi/simpledns
## configure example
see [conf dir](https://github.com/chennqqi/simpledns/tree/master/conf)
# usage
./simpledns -conf [configure uri]
## docker
build:
./builddocker.sh
or pull:
docker pull sort/simpledns
## known issue
* consul service not support udp check
## with consul as backend
add a forward upstream in forwards section, see [example](https://github.com/chennqqi/simpledns/tree/master/conf/simpledns.yml)
- name: consul.
cache_expire: 5m
upstreams:
- 'udp://127.0.0.1:8600'
## with k8s/coredns as backend
- name: cluster.local.
cache_expire: 5m
upstreams:
- 'udp://xx.xx.xx.xx:53'
## ping check
servers:
- name: example.com.
v_zones:
- match_clients: [ "127.0.0.1/24" ]
file: 'conf/zones/t.example.com'
checker: 'ping 10s' # every 10s check once
note: if after ping check, this was no one valid ipaddr. it will ignore check result, return all result.
## TODO:
* control api, support ddns
* tcp dns service
* multiplex tcp check and tcp dns service
* add geo based zone query
* performance test
## License
Apache 2.0 license. See the [LICENSE](https://github.com/chennqqi/simpledns/blob/master/LICENSE) file for details.