NextDNS on OpenWrt: device names are not reported

Hello. I have installed luci-app-nextdns git-20.105.64099-eeba108-1 and nextdns 1.4.23-1 on my OpenWRT 19.07.02. Everything works well and nextDNS' logs on the site report that I am using the CLI client and queries are encrypted with DoH.

The only problem is that I am trying to get the device names to appear in the panel, not just the IP. I see both the public and the private IP of each device, so the report client info setting works.

I have added all my devices IPs in OpenWRT's /etc/hosts, and I have checked that use-hosts is on true in nextdns config list. Weirdly, only one device name appears after the random device names generated by NextDNS, and that is 'OpenWRT'. Is it reading a different host file?

I've also tried rebooting the router.. no dice

@olivier

logread shows that the hosts are being read properly:
dnsmasq[9605]: read /etc/hosts - 16 addresses

Same issue here...
Notes:

  1. DHCP server is in my main router Mikrotik which I have connected an OpenWrt (NextDNS DoH) device to it as an AP which serves both extending coverage and DNS through forwarding port 53 requests to the AP.
  2. I'm blocking mDNS in my network.

I can see clear names in my DHCP pool. My ARP is reply-only.

I checked the source code on GitHub and turns out NextDNS CLI won't use its discovery services while listening only on localhost. Im looking for ways to isolate it from openwrt's localhost. My setup is written above this post (recently enabled mDNS again), what way should I follow?

line 289.

If you block mdns and have the DHCP lease on a different server, it does not leave a lot of options for nextdns to discover your names :slight_smile:

One option would be DNS to you Mirotik. Make sure the OpenWRT gets the Mikrotik as a DNS resolver via DHCP, nextdns will try to resolve IP reverses using this DNS IP.

Thanks for the reply. I removed the mDNS block but still nothing showing up. In OpenWrt logs, I don't see NextDNS: Starting Discovery... kind of log either, GitHub shows that its only for listening outside of the localhost, how's that even possible for my situation?

Yes, OpenWrt AP gets its IP, gateway and DNS server via DHCP from Mikrotik router. DNS server IP is set to the AP's IP btw. In Mikrotik router, I'm also dst-nat'ting UDP 53 requests to the IP of OpenWrt AP, this way I can force users to use my defined DNS server which is NextDNS on the AP.

Can you please show you config?

Which config do you specifically ask for other than the ones I wrote above?

The result of nextdns config

root@AccessPoint:~# nextdns config
setup-router false
auto-activate false
config blabla
log-queries false
detect-captive-portals false
use-hosts true
timeout 5s
listen 127.0.0.1:5342
report-client-info true
hardened-privacy true
bogus-priv true

edit: I do not need dnsmasq (or DHCP of the AP), if it makes things simpler, I can disable it, just learnt that enabling cache on NextDNS disables it autoamtically, then I must change the port to 53 from 5342 right?

I disabled dnsmasq and force NextDNS to listen on APsIP:53. Then I finally saw discovery starting log for the first time but it didnt again discover any name. However it said mDNS discovered for 192.168.1.29 which is my phone but its IP as its host name.

I have tried all the combinations but nothing was perfect. Spent extra time due to OpenWrt's handicapped system (lots of reboots).

If I disable dnsmasq forwarding, even the OpenWrt access point loses its name on the web log. So I need dnsmasq prior to NextDNS.
If I set NextDNS to listen on 127.0.0.1, I lose discovery services.
If I set NextDNS to listen on its AP IP 192.168.1.253:5342 with dnsmasq listening on localhost 127.0.0.1:53, I get the AP's name and I get several devices name as well via mDNS but not all.

Thing is I guess NextDNS fully rely on DHCP for active IP hostnames and thats why its not working. We gonna need a different approach on this, or just have the capability to manually add hostnames which will be annoying but I may write a script from Mikrotik to feed that manual file regularly.

I couldn't came up with anything else, and I really wanted Mikrotik to implement DoH, thats why Im struggling with OpenWrt in the first place.

UPDATE: I reseted the OpenWrt, installed the latest NextDNS CLI, set it to listen on 192.168.1.253:5342, set dnsmasq forwarder to it, then populated the /etc/hosts and it worked.

Hey there,

I'm experiencing the same issue.

I've got an Archer A7 just setup fresh with OpenWrt 19.07.2 r10947-65030d81f3 and nextdns 1.5.8-1 via the opkg GUI.

Would you be able to provide a little more detail on how I might be able to resolve this? I'm new to the OpenWRT game.

hey, are you using your device as a router or simple AP?

I’m not a 100% that I have it setup correctly, but as a router. It’s the only device on my network acting as a DCHP.

ok then it should work with setup-router true parameter painlessly. you don't even need to populate etc/host manually or change its IP, it should read from your dhcp leases.

Gotcha. I installed NextDNS through the OpenWRT's gui (LuCI). The configuration options available for NextDNS through LuCI don't look like they expose that config option.

What's the best way to set it up?

Ok, so I was able to fix this issue by performing a reset and then installing the CLI using these instructions.

Previously, I was using these instructions which use LuCI's opkg.

you can edit it in /etc/config/nextdns with cli basic commands.