feat: add upstream default upstream dns server as CLI flag

pull/1/head
Adam Veldhousen 2021-06-10 10:51:09 -05:00
parent 9320c2675a
commit 4b0589ddb0
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B
1 changed files with 5 additions and 4 deletions

View File

@ -13,9 +13,10 @@ import (
)
var (
dbPath = flag.String("db-path", ".", "Directory to write database files to")
httpAddr = flag.String("http-address", ":80", "Bind address for http server")
dnsAddr = flag.String("dns-address", ":53", "Bind address for dns server")
dbPath = flag.String("db-path", ".", "Directory to write database files to")
httpAddr = flag.String("http-address", ":80", "Bind address for http server")
dnsAddr = flag.String("dns-address", ":53", "Bind address for dns server")
defaultUpstream = flag.String("upstream", "1.1.1.1:53", "default upstream DNS server when no others are specified")
)
func main() {
@ -57,7 +58,7 @@ func main() {
Storage: store,
RuleEvaluator: re,
Recursors: internal.Recursor{
Upstreams: []string{"1.1.1.1:53"},
Upstreams: []string{*defaultUpstream},
Client: dnsClient,
},
}