From 1e55db408f78eccb36f2bd4afa719c1c9d88c470 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Tue, 1 Jun 2021 14:28:34 +0300 Subject: [PATCH] Pull request: 3136 show default resolvers Merge in DNS/adguard-home from 3136-show-default to master Closes #3136. Squashed commit of the following: commit add09a772dddcccd404056e7649c2d3350a79fec Author: Eugene Burkov Date: Tue Jun 1 11:11:24 2021 +0300 openapi: fix typo commit 69e402c49318d53a0d03b81207644d9fb04a139a Merge: 76e8492c e17e1f20 Author: Eugene Burkov Date: Tue Jun 1 11:09:51 2021 +0300 Merge branch 'master' into 3136-show-default commit 76e8492c8da679e204ceb7a77f1c6f73a2488040 Author: Ildar Kamalov Date: Tue Jun 1 10:55:09 2021 +0300 client: check upstreams commit 05fe6ea196a1ed9386eec25dbfbe22779fe7bcfd Author: Vlad Date: Mon May 31 19:23:35 2021 +0300 add defaul resolvers line commit 8d63c7df9947c9588478d1173834b42569fd8951 Author: Eugene Burkov Date: Mon May 31 11:56:08 2021 +0300 all: imp changelog commit e3912e3b20eca9dcf90ddddaa5edb54d1e0cfe6e Author: Eugene Burkov Date: Fri May 28 20:23:05 2021 +0300 all: add local ptr resolvers addresses output --- CHANGELOG.md | 2 + client/src/__locales/en.json | 2 + .../components/Settings/Dns/Upstream/Form.js | 11 +++++ internal/aghnet/systemresolvers.go | 4 +- internal/dnsforward/dnsforward.go | 48 +++++++++++-------- internal/dnsforward/http.go | 19 ++++++-- internal/dnsforward/http_test.go | 17 +++++++ openapi/CHANGELOG.md | 6 +++ openapi/openapi.yaml | 12 ++++- 9 files changed, 95 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4153a51..651a2516 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to ### Added +- Output of the default addresses of the upstreams used for resolving PTRs for + private addresses ([#3136]). - Detection and handling of recurrent PTR requests for locally-served addresses ([#3185]). - The ability to completely disable reverse DNS resolving of IPs from diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index d65585e0..dd39cbfd 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -10,6 +10,8 @@ "bootstrap_dns_desc": "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams.", "local_ptr_title": "Private reverse DNS servers", "local_ptr_desc": "The DNS servers that AdGuard Home uses for local PTR queries. These servers are used to resolve the hostnames of clients with private IP addresses, for example \"192.168.12.34\", using rDNS. If not set, AdGuard Home uses the default DNS resolvers of your OS.", + "local_ptr_default_resolver": "By default, AdGuard Home will use the following DNS resolvers: {{ip}}", + "local_ptr_no_default_resolver": "AdGuard Home could not determine suitable private rDNS resolvers for this system.", "local_ptr_placeholder": "Enter one server address per line", "resolve_clients_title": "Enable reverse resolving of clients' IP addresses", "resolve_clients_desc": "If enabled, AdGuard Home will attempt to reversely resolve clients' IP addresses into their hostnames by sending PTR queries to corresponding resolvers (private DNS servers for local clients, upstream servers for clients with public IP addresses).", diff --git a/client/src/components/Settings/Dns/Upstream/Form.js b/client/src/components/Settings/Dns/Upstream/Form.js index 99364549..0e688393 100644 --- a/client/src/components/Settings/Dns/Upstream/Form.js +++ b/client/src/components/Settings/Dns/Upstream/Form.js @@ -143,6 +143,9 @@ const Form = ({ const upstream_dns = useSelector((store) => store.form[FORM_NAME.UPSTREAM].values.upstream_dns); const processingTestUpstream = useSelector((state) => state.settings.processingTestUpstream); const processingSetConfig = useSelector((state) => state.dnsConfig.processingSetConfig); + const defaultLocalPtrUpstreams = useSelector( + (state) => state.dnsConfig.default_local_ptr_upstreams, + ); const handleUpstreamTest = () => dispatch(testUpstreamWithFormValues()); @@ -212,6 +215,14 @@ const Form = ({
local_ptr_desc
+
+ {/** TODO: Add internazionalization for "" */} + {defaultLocalPtrUpstreams?.length > 0 ? ( + `"${s}"`).join(', ') }}>local_ptr_default_resolver + ) : ( + local_ptr_no_default_resolver + )} +