Skip to content

Commit

Permalink
Pull request: upstream: change doq port to 853
Browse files Browse the repository at this point in the history
Merge in DNS/dnsproxy from 4276-doq-port to master

Updates AdguardTeam/AdGuardHome#4276.

Squashed commit of the following:

commit 3c889cd
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Mar 21 20:10:40 2022 +0300

    upstream: rm deprecated stuff

commit 94f86fb
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Mar 21 20:04:08 2022 +0300

    upstream: change doq port to 853
  • Loading branch information
EugeneOne1 committed Mar 21, 2022
1 parent 4b01458 commit f5c11d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ Runs a DNS-over-HTTPS proxy on `127.0.0.1:443`.
./dnsproxy -l 127.0.0.1 --https-port=443 --tls-crt=example.crt --tls-key=example.key -u 8.8.8.8:53 -p 0
```

Runs a DNS-over-QUIC proxy on `127.0.0.1:8853`.
Runs a DNS-over-QUIC proxy on `127.0.0.1:853`.
```shell
./dnsproxy -l 127.0.0.1 --quic-port=8853 --tls-crt=example.crt --tls-key=example.key -u 8.8.8.8:53 -p 0
./dnsproxy -l 127.0.0.1 --quic-port=853 --tls-crt=example.crt --tls-key=example.key -u 8.8.8.8:53 -p 0
```

Runs a DNSCrypt proxy on `127.0.0.1:443`.
Expand Down
20 changes: 4 additions & 16 deletions upstream/upstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,11 @@ const (
// defaultPortDoT is the default port for DNS-over-TLS.
defaultPortDoT = 853

// defaultPortDoQ is the default port for DNS-over-QUIC.
// defaultPortDoQ is the default port for DNS-over-QUIC. Prior to version
// -10 of the draft experiments were directed to use ports 8853, 784.
//
// Early experiments MAY use port 8853. This port is marked in the IANA
// registry as unassigned. Note that prior to version -02 of this draft,
// experiments were directed to use port 784.
//
// See https://datatracker.ietf.org/doc/html/draft-ietf-dprive-dnsoquic-02#section-10.2.1.
defaultPortDoQ = 8853
// See https://datatracker.ietf.org/doc/html/draft-ietf-dprive-dnsoquic-10#section-10.2.
defaultPortDoQ = 853
)

// AddressToUpstream converts addr to an Upstream instance:
Expand Down Expand Up @@ -126,15 +123,6 @@ func urlToUpstream(uu *url.URL, opts *Options) (u Upstream, err error) {
switch sch := uu.Scheme; sch {
case "sdns":
return stampToUpstream(uu, opts)
// TODO(e.burkov): Remove in the next major-minor release.
case "dns":
log.Info(
"warning: using %q scheme is deprecated and will be removed in future versions; "+
"use \"udp\" instead",
sch,
)

return newPlain(uu, opts.Timeout, false), nil
case "udp", "tcp":
return newPlain(uu, opts.Timeout, sch == "tcp"), nil
case "quic":
Expand Down
4 changes: 4 additions & 0 deletions upstream/upstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ func TestAddressToUpstream(t *testing.T) {
addr: "one.one.one.one",
opt: nil,
want: "one.one.one.one:53",
}, {
addr: "udp://one.one.one.one",
opt: nil,
want: "one.one.one.one:53",
}, {
addr: "tcp://one.one.one.one",
opt: opt,
Expand Down

0 comments on commit f5c11d4

Please sign in to comment.