Skip to content

Commit 25e110a

Browse files
committedAug 20, 2024
Pull request 377: ADG-8932 Hosts
Squashed commit of the following: commit 3f18744 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 19:38:20 2024 +0300 cmd: parse better commit a44ba8c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 19:35:36 2024 +0300 handler: fix doc commit 59750f9 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 19:32:48 2024 +0300 all: fix go-flags commit 8fec401 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 17:20:09 2024 +0300 all: imp code, skel commit 76d3cd6 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 16:40:26 2024 +0300 all: imp code commit 50f32a3 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 16:29:38 2024 +0300 all: imp code, ifaces commit cce416f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 14:51:31 2024 +0300 all: upd go, golibs commit 5f56f30 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Aug 19 14:38:37 2024 +0300 all: hosts handler
1 parent ae6b69c commit 25e110a

File tree

20 files changed

+718
-145
lines changed

20 files changed

+718
-145
lines changed
 

‎Makefile

+19-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Makefile. Bump this number every time a significant change is made to
99
# this Makefile.
1010
#
11-
# AdGuard-Project-Version: 5
11+
# AdGuard-Project-Version: 6
1212

1313
# Don't name these macros "GO" etc., because GNU Make apparently makes
1414
# them exported environment variables with the literal value of
@@ -24,19 +24,20 @@ BRANCH = $$( git rev-parse --abbrev-ref HEAD )
2424
DIST_DIR = build
2525
GOAMD64 = v1
2626
GOPROXY = https://proxy.golang.org|direct
27-
GOTOOLCHAIN = go1.22.5
27+
GOTOOLCHAIN = go1.22.6
28+
GOTELEMETRY = off
2829
OUT = dnsproxy
2930
RACE = 0
3031
REVISION = $$( git rev-parse --short HEAD )
3132
VERSION = 0
3233

3334
ENV = env\
3435
BRANCH="$(BRANCH)"\
35-
COMMIT='$(COMMIT)'\
3636
DIST_DIR='$(DIST_DIR)'\
3737
GO="$(GO.MACRO)"\
3838
GOAMD64='$(GOAMD64)'\
3939
GOPROXY='$(GOPROXY)'\
40+
GOTELEMETRY='$(GOTELEMETRY)'\
4041
GOTOOLCHAIN='$(GOTOOLCHAIN)'\
4142
OUT='$(OUT)'\
4243
PATH="$${PWD}/bin:$$( "$(GO.MACRO)" env GOPATH )/bin:$${PATH}"\
@@ -47,6 +48,11 @@ ENV = env\
4748

4849
# Keep the line above blank.
4950

51+
ENV_MISC = env\
52+
VERBOSE="$(VERBOSE.MACRO)"\
53+
54+
# Keep the line above blank.
55+
5056
# Keep this target first, so that a naked make invocation triggers a
5157
# full build.
5258
build: go-deps go-build
@@ -55,13 +61,13 @@ init: ; git config core.hooksPath ./scripts/hooks
5561

5662
test: go-test
5763

58-
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
59-
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
60-
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
61-
go-test: ; $(ENV) RACE='1' "$(SHELL)" ./scripts/make/go-test.sh
62-
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
63-
64-
go-upd-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-upd-tools.sh
64+
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
65+
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
66+
go-env: ; $(ENV) "$(GO.MACRO)" env
67+
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
68+
go-test: ; $(ENV) RACE='1' "$(SHELL)" ./scripts/make/go-test.sh
69+
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
70+
go-upd-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-upd-tools.sh
6571

6672
go-check: go-tools go-lint go-test
6773

@@ -76,6 +82,9 @@ go-os-check:
7682

7783
txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
7884

85+
md-lint: ; $(ENV_MISC) "$(SHELL)" ./scripts/make/md-lint.sh
86+
sh-lint: ; $(ENV_MISC) "$(SHELL)" ./scripts/make/sh-lint.sh
87+
7988
clean: ; $(ENV) $(GO.MACRO) clean && rm -f -r '$(DIST_DIR)'
8089

8190
release: clean

‎README.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,38 @@ Usage:
4848
dnsproxy [OPTIONS]
4949
5050
Application Options:
51-
--config-path= yaml configuration file. Minimal working configuration in config.yaml.dist. Options passed through command line will override the ones from this file.
51+
--config-path= yaml configuration file. Minimal working configuration in config.yaml.dist. Options passed through command
52+
line will override the ones from this file.
5253
-o, --output= Path to the log file. If not set, write to stdout.
5354
-c, --tls-crt= Path to a file with the certificate chain
5455
-k, --tls-key= Path to a file with the private key
5556
--https-server-name= Set the Server header for the responses from the HTTPS server. (default: dnsproxy)
5657
--https-userinfo= If set, all DoH queries are required to have this basic authentication information.
5758
-g, --dnscrypt-config= Path to a file with DNSCrypt configuration. You can generate one using https://github.com/ameshkov/dnscrypt
5859
--edns-addr= Send EDNS Client Address
59-
--upstream-mode= Defines the upstreams logic mode, possible values: load_balance, parallel, fastest_addr (default: load_balance)
60+
--upstream-mode= Defines the upstreams logic mode, possible values: load_balance, parallel, fastest_addr (default:
61+
load_balance)
6062
-l, --listen= Listening addresses
6163
-p, --port= Listening ports. Zero value disables TCP and UDP listeners
6264
-s, --https-port= Listening ports for DNS-over-HTTPS
6365
-t, --tls-port= Listening ports for DNS-over-TLS
6466
-q, --quic-port= Listening ports for DNS-over-QUIC
6567
-y, --dnscrypt-port= Listening ports for DNSCrypt
66-
-u, --upstream= An upstream to be used (can be specified multiple times). You can also specify path to a file with the list of servers
68+
-u, --upstream= An upstream to be used (can be specified multiple times). You can also specify path to a file with the
69+
list of servers
6770
-b, --bootstrap= Bootstrap DNS for DoH and DoT, can be specified multiple times (default: use system-provided)
68-
-f, --fallback= Fallback resolvers to use when regular ones are unavailable, can be specified multiple times. You can also specify path to a file with the list of servers
71+
-f, --fallback= Fallback resolvers to use when regular ones are unavailable, can be specified multiple times. You can also
72+
specify path to a file with the list of servers
6973
--private-rdns-upstream= Private DNS upstreams to use for reverse DNS lookups of private addresses, can be specified multiple times
70-
--dns64-prefix= Prefix used to handle DNS64. If not specified, dnsproxy uses the 'Well-Known Prefix' 64:ff9b::. Can be specified multiple times
74+
--dns64-prefix= Prefix used to handle DNS64. If not specified, dnsproxy uses the 'Well-Known Prefix' 64:ff9b::. Can be
75+
specified multiple times
7176
--private-subnets= Private subnets to use for reverse DNS lookups of private addresses
72-
--bogus-nxdomain= Transform the responses containing at least a single IP that matches specified addresses and CIDRs into NXDOMAIN. Can be specified multiple times.
77+
--bogus-nxdomain= Transform the responses containing at least a single IP that matches specified addresses and CIDRs into
78+
NXDOMAIN. Can be specified multiple times.
79+
--hosts-files= List of paths to the hosts files relative to the root, can be specified multiple times
7380
--timeout= Timeout for outbound DNS queries to remote upstream servers in a human-readable form (default: 10s)
74-
--cache-min-ttl= Minimum TTL value for DNS entries, in seconds. Capped at 3600. Artificially extending TTLs should only be done with careful consideration.
81+
--cache-min-ttl= Minimum TTL value for DNS entries, in seconds. Capped at 3600. Artificially extending TTLs should only be
82+
done with careful consideration.
7583
--cache-max-ttl= Maximum TTL value for DNS entries, in seconds.
7684
--cache-size= Cache size (in bytes). Default: 64k
7785
-r, --ratelimit= Ratelimit (requests per second)
@@ -93,6 +101,7 @@ Application Options:
93101
--edns Use EDNS Client Subnet extension
94102
--dns64 If specified, dnsproxy will act as a DNS64 server
95103
--use-private-rdns If specified, use private upstreams for reverse DNS lookups of private addresses
104+
--hosts-file-enabled= If specified, use hosts files for resolving (default: true)
96105
97106
Help Options:
98107
-h, --help Show this help message

‎bamboo-specs/bamboo.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
# exact patch version as opposed to a minor one to make sure that this exact
1111
# version is actually used and not whatever the docker daemon on the CI has
1212
# cached a few months ago.
13-
'dockerGo': 'golang:1.22.5'
13+
'dockerGo': 'golang:1.22.6'
1414
'maintainer': 'Adguard Go Team'
1515
'name': 'dnsproxy'
1616

1717
'stages':
18+
# TODO(e.burkov): Add separate lint stage for texts.
1819
- 'Lint':
1920
'manual': false
2021
'final': false

‎go.mod

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
module github.com/AdguardTeam/dnsproxy
22

3-
go 1.22.5
3+
go 1.22.6
44

55
require (
6-
github.com/AdguardTeam/golibs v0.25.2
6+
github.com/AdguardTeam/golibs v0.26.0
77
github.com/ameshkov/dnscrypt/v2 v2.2.7
88
github.com/ameshkov/dnsstamps v1.0.3
99
github.com/beefsack/go-rate v0.0.0-20220214233405-116f4ca011a0
1010
github.com/bluele/gcache v0.0.2
11-
github.com/jessevdk/go-flags v1.5.0
11+
github.com/jessevdk/go-flags v1.6.1
1212
github.com/miekg/dns v1.1.58
1313
github.com/patrickmn/go-cache v2.1.0+incompatible
1414
github.com/quic-go/quic-go v0.44.0
1515
github.com/stretchr/testify v1.9.0
16-
golang.org/x/exp v0.0.0-20240707233637-46b078467d37
17-
golang.org/x/net v0.27.0
18-
golang.org/x/sys v0.22.0
16+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
17+
golang.org/x/net v0.28.0
18+
golang.org/x/sys v0.24.0
1919
gopkg.in/yaml.v3 v3.0.1
2020
)
2121

@@ -31,11 +31,11 @@ require (
3131
github.com/pmezard/go-difflib v1.0.0 // indirect
3232
github.com/quic-go/qpack v0.4.0 // indirect
3333
go.uber.org/mock v0.4.0 // indirect
34-
golang.org/x/crypto v0.25.0 // indirect
35-
golang.org/x/mod v0.19.0 // indirect
36-
golang.org/x/sync v0.7.0 // indirect
37-
golang.org/x/text v0.16.0 // indirect
38-
golang.org/x/tools v0.23.0 // indirect
34+
golang.org/x/crypto v0.26.0 // indirect
35+
golang.org/x/mod v0.20.0 // indirect
36+
golang.org/x/sync v0.8.0 // indirect
37+
golang.org/x/text v0.17.0 // indirect
38+
golang.org/x/tools v0.24.0 // indirect
3939
gonum.org/v1/gonum v0.14.0
4040
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
4141
)

‎go.sum

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/AdguardTeam/golibs v0.25.2 h1:4+c9LjAIdd9trRk71hXghJ5OL/VRosBm+/0dKH+H39U=
2-
github.com/AdguardTeam/golibs v0.25.2/go.mod h1:HaTyS2wCbxFudjht9N/+/Qf1b5cMad2BAYSwe7DPCXI=
1+
github.com/AdguardTeam/golibs v0.26.0 h1:uLL0XggEjB+87lL1tPpEAQNoKAlHDq5AyBUVWEgf63E=
2+
github.com/AdguardTeam/golibs v0.26.0/go.mod h1:iWdjXPCwmK2g2FKIb/OwEPnovSXeMqRhI8FWLxF5oxE=
33
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
44
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
55
github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
@@ -26,8 +26,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2626
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2727
github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e h1:E+3PBMCXn0ma79O7iCrne0iUpKtZ7rIcZvoz+jNtNtw=
2828
github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik=
29-
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
30-
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
29+
github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4=
30+
github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc=
3131
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
3232
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
3333
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -54,25 +54,24 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
5454
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
5555
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
5656
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
57-
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
58-
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
59-
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w=
60-
golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
61-
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
62-
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
63-
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
64-
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
65-
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
66-
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
67-
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
68-
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
69-
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
70-
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
71-
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
57+
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
58+
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
59+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=
60+
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
61+
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
62+
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
63+
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
64+
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
65+
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
66+
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
67+
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
68+
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
69+
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
70+
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
7271
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
7372
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
74-
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
75-
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
73+
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
74+
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
7675
gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0=
7776
gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU=
7877
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=

‎internal/cmd/config.go

+15-4
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,23 @@ func createProxyConfig(
4949
l *slog.Logger,
5050
options *Options,
5151
) (conf *proxy.Config, err error) {
52-
reqHdlr := handler.NewDefault(&handler.DefaultConfig{
52+
hostsFiles, err := options.hostsFiles(ctx, l)
53+
if err != nil {
54+
// Don't wrap the error since it's informative enough as is.
55+
return nil, err
56+
}
57+
58+
reqHdlr, err := handler.NewDefault(&handler.DefaultConfig{
5359
Logger: l.With(slogutil.KeyPrefix, "default_handler"),
5460
// TODO(e.burkov): Use the configured message constructor.
5561
MessageConstructor: dnsmsg.DefaultMessageConstructor{},
5662
HaltIPv6: options.IPv6Disabled,
63+
HostsFiles: hostsFiles,
64+
FileSystem: osutil.RootDirFS(),
5765
})
66+
if err != nil {
67+
return nil, fmt.Errorf("creating default handler: %w", err)
68+
}
5869

5970
conf = &proxy.Config{
6071
Logger: l.With(slogutil.KeyPrefix, proxy.LogPrefix),
@@ -141,7 +152,7 @@ func (opts *Options) initUpstreams(
141152
Logger: l,
142153
HTTPVersions: httpVersions,
143154
InsecureSkipVerify: opts.Insecure,
144-
Timeout: timeout,
155+
Timeout: timeout.Duration,
145156
}
146157
boot, err := initBootstrap(ctx, l, opts.BootstrapDNS, bootOpts)
147158
if err != nil {
@@ -153,7 +164,7 @@ func (opts *Options) initUpstreams(
153164
HTTPVersions: httpVersions,
154165
InsecureSkipVerify: opts.Insecure,
155166
Bootstrap: boot,
156-
Timeout: timeout,
167+
Timeout: timeout.Duration,
157168
}
158169
upstreams := loadServersList(opts.Upstreams)
159170

@@ -166,7 +177,7 @@ func (opts *Options) initUpstreams(
166177
Logger: l,
167178
HTTPVersions: httpVersions,
168179
Bootstrap: boot,
169-
Timeout: min(defaultLocalTimeout, timeout),
180+
Timeout: min(defaultLocalTimeout, timeout.Duration),
170181
}
171182
privateUpstreams := loadServersList(opts.PrivateRDNSUpstreams)
172183

0 commit comments

Comments
 (0)
Failed to load comments.