# Configuring NextDNS

**URL:** <https://forum.openwrt.org/t/configuring-nextdns/52466>\
**Category:** Network and Wireless Configuration\
**Created:** [January 12, 2020, 3:17pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466 "2020-01-12T15:17:38Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 3:17pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/1 "2020-01-12T15:17:38Z")

</div>

I am trying to configure **nextdns** on the router (snapshot) and installed **luci-app-nextdns** on a working router. The page shows that the service is enabled and the executable is indeed running, but no changes are made to **/etc/config/dhcp** for dnsmasq to actually use **nextdns**. @olivier Is that by design?

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [January 12, 2020, 6:40pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/2 "2020-01-12T18:40:01Z")

</div>

Are resolutions going thru nextdns then or it does not work?

It does not change visible router settings, but add some directives to the dnsmasq configuration under the hood in a place that is easy to remove when the process exit.

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 7:16pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/3 "2020-01-12T19:16:26Z")

</div>

> [@olivier](#):
>
> Are resolutions going thru nextdns then or it does not work?

It did not work. My router was configured with **stubby** and **cleanbrowsing** and after installing **nextdns** , the resolution was still going through **cleanbrowsing**.

> [@olivier](#):
>
> It does not change visible router settings, but add some directives to the dnsmasq configuration under the hood in a place that is easy to remove when the process exit.

I checked **/etc/config/dhcp** and there were no changes made. Can you tell me what file is supposed to be changed by **nextdns**?

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [January 12, 2020, 7:29pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/4 "2020-01-12T19:29:23Z")

</div>

You should see a file called /tmp/dnsmasq.d/nextdns.conf.

Can you please show the out of:

```
cat /var/etc/dnsmasq.conf.*

```

as well as:

```
nextdns version

```

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 7:35pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/5 "2020-01-12T19:35:24Z")

</div>

It is all working now, but I had to add **list server '127.0.0.1#5342'** to **/etc/config/dhcp** and disable dense validation in dnsmasq.

```
cat /tmp/dnsmasq.d/nextdns.conf
server=127.0.0.1#5342
no-resolv
add-mac
add-subnet=32,128

```

```
nextdns version
nextdns version 1.3.1

```

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [January 12, 2020, 7:37pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/6 "2020-01-12T19:37:41Z")

</div>

can you please `cat /var/etc/dnsmasq.conf.*`

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 7:59pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/7 "2020-01-12T19:59:03Z")

</div>

It is slightly stripped...

```
cat /var/etc/dnsmasq.conf.*
# auto-generated config file from /etc/config/dhcp
conf-file=/etc/dnsmasq.conf
dhcp-authoritative
domain-needed
filterwin2k
no-resolv
localise-queries
read-ethers
enable-ubus
expand-hosts
bind-dynamic
dhcp-sequential-ip
cache-size=1500
dns-forward-max=150
domain=blah
server=/lan/
server=127.0.0.1#5453
server=/openwrt.pool.ntp.org/9.9.9.9
server=/cdnjs.cloudflare.com/9.9.9.9
dhcp-leasefile=/tmp/dhcp.leases
servers-file=/root/adb_list.overall
stop-dns-rebind
conf-file=/usr/share/dnsmasq/trust-anchors.conf
dnssec
dnssec-no-timecheck
dhcp-broadcast=tag:needs-broadcast
addn-hosts=/tmp/hosts
conf-dir=/tmp/dnsmasq.d
user=dnsmasq
group=dnsmasq
dhcp-host=[stripped]
dhcp-ignore-names=tag:dhcp_bogus_hostname
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf
bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,blah
dhcp-range=set:iot,blah
enable-ra
quiet-ra

```

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [January 12, 2020, 8:31pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/8 "2020-01-12T20:31:28Z")

</div>

Ok got it. You'll have to remove the forwarders you've set in the DHCP/DNS config for now. Next revision will handle that automatically.

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 8:50pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/9 "2020-01-12T20:50:19Z")

</div>

For now, I have setup stubby to talk to NextDNS. I will try your fix when it is available.

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 9:10pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/10 "2020-01-12T21:10:47Z")

</div>

A somewhat related question: what is the benefit of using **nextdns** over **stubby** here? You app is written in Go, so it is ginormous 🙂 I guess your app can provide some granular configurability. Are there any other big differences?

UPDATE: In both cases, my router would be connecting to NextDNS.

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [January 12, 2020, 9:21pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/11 "2020-01-12T21:21:19Z")

</div>

We are working on the size, it should get smaller, but still bigger than dynamically linked C programs.

The main advantages are:

- We use different routing and fallback techniques to connect to our servers, so you should get a closer server (lower latency) and in case of issue, it will try very hard to find another (farther) server before failing.
- Stubby has some known issue with our service where it get unstable in some cases (we are still investigating)
- Our daemon is able to discover your LAN hosts (if you enable the Report Client Info) and show them in the analytics (you need the very last version of nextdns for this to work well, which is not yet pushed to opkg, coming soon).
- You can apply different NextDNS configuration ID based on the subnet/IP/MAC address of the LAN client. This is very handy to apply kid specific config on kid devices (not yet implemented in the UI tho).

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 12, 2020, 9:25pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/12 "2020-01-12T21:25:54Z")

</div>

Thx, looking forward to all these improvements!

---

<div class="post-metadata">

**Author:** ![fantom-x](https://forum.openwrt.org/letter_avatar/fantom-x/32/6_449c533f586939b6e5f246632a46421f.png) [@fantom-x](https://forum.openwrt.org/u/fantom-x)\
**Post date:** [January 13, 2020, 12:38am UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/13 "2020-01-13T00:38:02Z")

</div>

I have this entry **list server '/openwrt.pool.ntp.org/9.9.9.9'** in **/etc/config/dhcp** and as I understand it is to handle the case, when the router comes up with time way behind current and until the time is synced, SSL communications are not possible. Does your app handle this case or I am mistaken here?

---

<div class="post-metadata">

**Author:** ![Gustavo-FS](https://forum.openwrt.org/user_avatar/forum.openwrt.org/gustavo-fs/32/23135_2.png) [@Gustavo-FS](https://forum.openwrt.org/u/Gustavo-FS)\
**Post date:** [July 12, 2020, 2:12pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/14 "2020-07-12T14:12:50Z")

</div>

any news on this issue?

I wish I could segregate different settings for some networks to create parental control for children

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [July 12, 2020, 2:38pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/15 "2020-07-12T14:38:19Z")

</div>

Which part of the issue?

---

<div class="post-metadata">

**Author:** ![Gustavo-FS](https://forum.openwrt.org/user_avatar/forum.openwrt.org/gustavo-fs/32/23135_2.png) [@Gustavo-FS](https://forum.openwrt.org/u/Gustavo-FS)\
**Post date:** [July 12, 2020, 4:12pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/16 "2020-07-12T16:12:57Z")

</div>

> [@olivier](#):
>
> You can apply different NextDNS configuration ID based on the subnet/IP/MAC address of the LAN client. This is very handy to apply kid specific config on kid devices (not yet implemented in the UI tho).

How can i configure multiple ID configuration?

---

<div class="post-metadata">

**Author:** ![olivier](https://forum.openwrt.org/user_avatar/forum.openwrt.org/olivier/32/16738_2.png) [@olivier](https://forum.openwrt.org/u/olivier)\
**Post date:** [July 12, 2020, 4:57pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/17 "2020-07-12T16:57:04Z")

</div>

> **[nextdns/nextdns](https://github.com/nextdns/nextdns/wiki/Conditional-Configuration)**
>
> NextDNS CLI client (DoH Proxy). Contribute to nextdns/nextdns development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![sol](https://forum.openwrt.org/letter_avatar/sol/32/6_449c533f586939b6e5f246632a46421f.png) [@sol](https://forum.openwrt.org/u/sol)\
**Post date:** [October 21, 2020, 5:28pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/18 "2020-10-21T17:28:12Z")

</div>

Hi. I'm running the latest NextDNS (nextdns version 1.8.6) and have both one `option config` as well as a number of `list host_config` entries in `/etc/config/nextdns`. Yet, all the DNS queries from the `list host_config` MACs and subnets is now going only to the option configured in `option config`. I have tried restarting NextDNS as well as restarting the router, but to no avail.

Here's my config file, with the NextDNS configs blanked:

```
config nextdns main
    option enabled '1'

    option config ******

    list host_config 'E8:DE:27:C9:5F:04= ******' # Ripe Atlas Probe
    list host_config 'a4:4b:d5:45:e3:3d= ******' # Redmi Note 8 Phone
    list host_config '10.3.0.0/16= ******' # Corvus
    list host_config '10.4.0.0/16= ******' # Guest

    option report_client_info '1'
    option hardened_privacy '0'
    option log_queries '0'

```

**UPDATE** : changing the `list host_config` entries to `list config` entries seems to work. But I thought version 1.8.6 used `list host_config` for the individual MACs/IPs/subnets and `option config` for the main fallback config. 😕

---

<div class="post-metadata">

**Author:** ![Gustavo-FS](https://forum.openwrt.org/user_avatar/forum.openwrt.org/gustavo-fs/32/23135_2.png) [@Gustavo-FS](https://forum.openwrt.org/u/Gustavo-FS)\
**Post date:** [January 24, 2021, 10:26pm UTC](https://forum.openwrt.org/t/configuring-nextdns/52466/19 "2021-01-24T22:26:31Z")

</div>

242 / 5000

## Resultados de tradução

It seems to me some bug of configuration of nextdns Configuring IP allocated in the DNS settings and configuring an IP in the configuration rules should work anyway I never did a deployment with MAC but I believe it is worth the try.
