https://github.com/macrat/roundns
Simplest DNS server for health-checking and load-balancing.
https://github.com/macrat/roundns
Last synced: 12 months ago
JSON representation
Simplest DNS server for health-checking and load-balancing.
- Host: GitHub
- URL: https://github.com/macrat/roundns
- Owner: macrat
- License: mit
- Created: 2020-12-20T11:49:54.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-11T12:59:40.000Z (over 5 years ago)
- Last Synced: 2023-03-04T02:13:31.556Z (over 3 years ago)
- Language: Go
- Homepage:
- Size: 92.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RoundNS
=======
Simplest DNS server for health-checking and load-balancing.
## How to use
### 1. Make config file
``` yaml
#address: :53
#log:
# level: warn
#metrics:
# namespace: roundns
# address: :8553
#ttl: 5m # default TTL
services:
- fqdn: a.test.local.
type: A
ttl: 300
strategy: round-robin
health:
command:
- "/bin/sh"
- "-c"
- "curl -fs http://$HOST"
interval: 1m
hosts:
- 127.0.0.1
- 127.0.0.2
- fqdn: b.test.local.
type: A
ttl: 5m
health:
command: curl -fs http://$HOST # It's shorthand of ["sh", "-c", "curl -fs http://$HOST"]
interval: 1h
hosts:
- 127.0.1.1
- 127.0.1.2
- fqdn: c.test.local.
type: A
health: curl -fs http://$HOST # It's shorthand more
hosts:
- 127.0.1.1
- 127.0.1.2
# load balancing without health checking
- fqdn: cname.test.local.
type: CNAME
hosts:
- a.test.local.
- b.test.local.
```
### 2. Run server
``` shell
$ roundns -config ./config.yml
```
Now server is running on 0.0.0.0:53/udp, and you can get metrics on http://127.0.0.1:8553/metrics