fix: configuration for FQDN only resolver (#1025)

This commit is contained in:
ThinkChaos 2023-05-15 10:24:07 -04:00 committed by GitHub
parent 1b478d047a
commit 795f3ddf93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 2 deletions

View File

@ -178,7 +178,7 @@ type Config struct {
KeyFile string `yaml:"keyFile"`
BootstrapDNS BootstrapDNSConfig `yaml:"bootstrapDns"`
HostsFile HostsFileConfig `yaml:"hostsFile"`
FqdnOnly FqdnOnlyConfig `yaml:",inline"`
FqdnOnly FqdnOnlyConfig `yaml:"fqdnOnly"`
Filtering FilteringConfig `yaml:"filtering"`
Ede EdeConfig `yaml:"ede"`
// Deprecated

View File

@ -550,6 +550,7 @@ func defaultTestFileConfig() {
Expect(config.Blocking.BlockTTL).Should(Equal(Duration(time.Minute)))
Expect(config.Blocking.RefreshPeriod).Should(Equal(Duration(2 * time.Hour)))
Expect(config.Filtering.QueryTypes).Should(HaveLen(2))
Expect(config.FqdnOnly.Enable).Should(BeTrue())
Expect(config.Caching.MaxCachingTime.IsZero()).Should(BeTrue())
Expect(config.Caching.MinCachingTime.IsZero()).Should(BeTrue())
@ -580,6 +581,8 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile {
" queryTypes:",
" - AAAA",
" - A",
"fqdnOnly:",
" enable: true",
"blocking:",
" blackLists:",
" ads:",
@ -617,6 +620,7 @@ func writeConfigYml(tmpDir *helpertest.TmpFolder) *helpertest.TmpFile {
"startVerifyUpstream: false")
}
//nolint:funlen
func writeConfigDir(tmpDir *helpertest.TmpFolder) error {
f1 := tmpDir.CreateStringFile("config1.yaml",
"upstream:",
@ -668,6 +672,8 @@ func writeConfigDir(tmpDir *helpertest.TmpFolder) error {
" singleNameOrder:",
" - 2",
" - 1",
"fqdnOnly:",
" enable: true",
"queryLog:",
" type: csv-client",
" target: /opt/log",

View File

@ -217,6 +217,7 @@ minTlsServeVersion: 1.3
# if https port > 0: path to cert and key file for SSL encryption. if not set, self-signed certificate will be generated
#certFile: server.crt
#keyFile: server.key
# optional: use these DNS servers to resolve blacklist urls and upstream DNS servers. It is useful if no system DNS resolver is configured, and/or to encrypt the bootstrap queries.
bootstrapDns:
- tcp+udp:1.1.1.1
@ -230,6 +231,11 @@ filtering:
queryTypes:
- AAAA
# optional: return NXDOMAIN for queries that are not FQDNs.
fqdnOnly:
# default: false
enable: true
# optional: if path defined, use this file for query resolution (A, AAAA and rDNS). Default: empty
hostsFile:
# optional: Path to hosts file (e.g. /etc/hosts on Linux)

View File

@ -195,7 +195,8 @@ Please be aware that by enabling it your hostname resolution will break unless e
!!! example
```yaml
fqdnOnly: true
fqdnOnly:
enable: true
```
## Custom DNS