Skip to content

Commit 7e88ee1

Browse files
committed
cmd: imp code
1 parent e9286ab commit 7e88ee1

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Usage of ./dnsproxy:
6363
Cache size (in bytes). Default: 64k.
6464
--config-path=path
6565
YAML configuration file. Minimal working configuration in config.yaml.dist. Options passed through command line will override the ones from this file.
66-
--dnssec-disabled
67-
If specified, the proxy won't manage the DO bit in upstream requests.
66+
--dnssec
67+
Defines whether the proxy should set the DO bits in the upstream requests. Default: true.
6868
--doh-insecure-enabled
6969
If specified, the DoH server will skip TLS certificate verification.
7070
--doh-routes

internal/cmd/args.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const (
6969
usePrivateRDNSIdx
7070
dohRoutesIdx
7171
dohInsecureEnabledIdx
72-
dnssecDisabledIdx
72+
dnssecEnabledIdx
7373
)
7474

7575
// commandLineOption contains information about a command-line option: its long
@@ -420,9 +420,9 @@ var commandLineOptions = []*commandLineOption{
420420
short: "",
421421
valueType: "",
422422
},
423-
dnssecDisabledIdx: {
424-
description: "If specified, the proxy won't manage the DO bits.",
425-
long: "dnssec-disabled",
423+
dnssecEnabledIdx: {
424+
description: "Defines whether the proxy should set the DO bits in the upstream requests.",
425+
long: "dnssec",
426426
short: "",
427427
valueType: "",
428428
},
@@ -487,7 +487,7 @@ func parseCmdLineOptions(conf *configuration) (err error) {
487487
usePrivateRDNSIdx: &conf.UsePrivateRDNS,
488488
dohRoutesIdx: &conf.DoHRoutes,
489489
dohInsecureEnabledIdx: &conf.DoHInsecureEnabled,
490-
dnssecDisabledIdx: &conf.DNSSECDisabled,
490+
dnssecEnabledIdx: &conf.DNSSECEnabled,
491491
} {
492492
addOption(flags, fieldPtr, commandLineOptions[i])
493493
}

internal/cmd/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ type configuration struct {
196196

197197
// DNSSECEnabled defines whether the proxy should set the DO bits in the
198198
// upstream requests.
199-
DNSSECDisabled bool `yaml:"dnssec-disabled"`
199+
DNSSECEnabled bool `yaml:"dnssec"`
200200

201201
// EnableEDNSSubnet uses EDNS Client Subnet extension.
202202
EnableEDNSSubnet bool `yaml:"edns"`
@@ -227,6 +227,7 @@ func parseConfig() (conf *configuration, exitCode int, err error) {
227227
OptimisticMaxAge: timeutil.Duration(proxy.DefaultOptimisticMaxAge),
228228
RatelimitSubnetLenIPv4: 24,
229229
RatelimitSubnetLenIPv6: 56,
230+
DNSSECEnabled: true,
230231
HostsFileEnabled: true,
231232
PendingRequestsEnabled: true,
232233
}

internal/cmd/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func createProxyConfig(
9898
netip.MustParsePrefix("0.0.0.0/0"),
9999
netip.MustParsePrefix("::0/0"),
100100
},
101-
DNSSECEnabled: !conf.DNSSECDisabled,
101+
DNSSECEnabled: conf.DNSSECEnabled,
102102
EnableEDNSClientSubnet: conf.EnableEDNSSubnet,
103103
UDPBufferSize: conf.UDPBufferSize,
104104
MaxGoroutines: conf.MaxGoRoutines,

0 commit comments

Comments
 (0)