Skip to content

Commit

Permalink
client: handle local ips rdns
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarKamalov committed May 26, 2021
1 parent 9a69183 commit 3651213
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 3 additions & 1 deletion client/src/__locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"load_balancing_desc": "Query one upstream server at a time. AdGuard Home will use the weighted random algorithm to pick the server so that the fastest server is used more often.",
"bootstrap_dns": "Bootstrap DNS servers",
"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 DNS servers",
"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_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 server for clients with public IP addresses).",
"local_ips_rdns_title": "Use private rDNS resolvers",
"local_ips_rdns_desc": "Perform reverse DNS lookups for locally-served addresses using these upstream servers. If disabled, AdGuard Home responds with NXDOMAIN to all such PTR requests except for clients known from DHCP, /etc/hosts, and so on.",
"check_dhcp_servers": "Check for DHCP servers",
"save_config": "Save configuration",
"enabled_dhcp": "DHCP server enabled",
Expand Down
17 changes: 15 additions & 2 deletions client/src/components/Settings/Dns/Upstream/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Form = ({
<Examples />
<hr />
</div>
<div className="col-12 mb-4">
<div className="col-12 mb-2">
<label
className="form__label form__label--with-desc"
htmlFor="bootstrap_dns"
Expand All @@ -202,7 +202,7 @@ const Form = ({
<div className="col-12">
<hr />
</div>
<div className="col-12 mb-4">
<div className="col-12">
<label
className="form__label form__label--with-desc"
htmlFor="local_ptr"
Expand All @@ -222,6 +222,19 @@ const Form = ({
disabled={processingSetConfig}
normalizeOnBlur={removeEmptyLines}
/>
<div className="mt-4">
<Field
name="local_ips_rdns"
type="checkbox"
component={CheckboxField}
placeholder={t('local_ips_rdns_title')}
subtitle={t('local_ips_rdns_desc')}
disabled={processingSetConfig}
/>
</div>
</div>
<div className="col-12">
<hr />
</div>
<div className="col-12 mb-4">
<Field
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/Settings/Dns/Upstream/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Upstream = () => {
upstream_mode,
resolve_clients,
local_ptr_upstreams,
local_ips_rdns,
} = useSelector((state) => state.dnsConfig, shallowEqual);

const upstream_dns_file = useSelector((state) => state.dnsConfig.upstream_dns_file);
Expand All @@ -25,13 +26,15 @@ const Upstream = () => {
upstream_mode,
resolve_clients,
local_ptr_upstreams,
local_ips_rdns,
} = values;

const dnsConfig = {
bootstrap_dns,
upstream_mode,
resolve_clients,
local_ptr_upstreams,
local_ips_rdns,
...(upstream_dns_file ? null : { upstream_dns }),
};

Expand All @@ -53,6 +56,7 @@ const Upstream = () => {
upstream_mode,
resolve_clients,
local_ptr_upstreams,
local_ips_rdns,
}}
onSubmit={handleSubmit}
/>
Expand Down

0 comments on commit 3651213

Please sign in to comment.