Skip to content

Commit

Permalink
all: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 26, 2024
1 parent b96522a commit ccca735
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Application Options:
--private-subnets= Private subnets to use for reverse DNS lookups of private addresses
--bogus-nxdomain= Transform the responses containing at least a single IP that matches specified addresses and CIDRs into
NXDOMAIN. Can be specified multiple times.
--hosts-files= List of paths to the hosts files relative to the root, can be specified multiple times
--hosts-files= List of paths to the hosts files, can be specified multiple times
--timeout= Timeout for outbound DNS queries to remote upstream servers in a human-readable form (default: 10s)
--cache-min-ttl= Minimum TTL value for DNS entries, in seconds. Capped at 3600. Artificially extending TTLs should only be
done with careful consideration.
Expand Down
9 changes: 4 additions & 5 deletions internal/cmd/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,10 @@ var commandLineOptions = []*commandLineOption{
valueType: "subnet",
},
hostsFilesIdx: {
description: "List of paths to the hosts files relative to the root, can be specified " +
"multiple times.",
long: "hosts-files",
short: "",
valueType: "path",
description: "List of paths to the hosts files, can be specified multiple times.",
long: "hosts-files",
short: "",
valueType: "path",
},
timeoutIdx: {
description: "Timeout for outbound DNS queries to remote upstream servers in a " +
Expand Down
7 changes: 6 additions & 1 deletion internal/handler/default_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/netip"
"os"
"path"
"path/filepath"
"testing"
"time"

Expand Down Expand Up @@ -84,7 +85,11 @@ func TestDefault_resolveFromHosts(t *testing.T) {
// TODO(e.burkov): Use the one from [dnsproxytest].
messages := dnsmsg.DefaultMessageConstructor{}

strg, err := ReadHosts([]string{path.Join("testdata", t.Name(), "hosts")})
relPath := path.Join("testdata", t.Name(), "hosts")
absPath, err := filepath.Abs(path.Join("testdata", t.Name(), "hosts.txt"))
require.NoError(t, err)

strg, err := ReadHosts([]string{absPath, relPath})
require.NoError(t, err)

hdlr, err := NewDefault(&DefaultConfig{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
1.2.3.4 ipv4.domain.example
2001:db8::1 ipv6.domain.example
# 2001:db8::1 ipv6.domain.example
# comment
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1.2.3.4 ipv4.domain.example
2001:db8::1 ipv6.domain.example
# comment

0 comments on commit ccca735

Please sign in to comment.