nextdns: OpenWRT: Client sets incorrect dnsmasq server address

Modified listen option in /etc/config/nextdns so NextDNS client binds on all interfaces in order to listen for mDNS across multiple local subnets. However, the :<port> value without an explicit IP causes the NextDNS client to generate an unusable server= entry for dnsmasq in /tmp/dnsmasq.d/nextdns.conf.

This causes dnsmasq to fail to start up.

NextDNS config:

root@OpenWrt:~# cat /etc/config/nextdns

config nextdns 'main'
	option enabled '1'
	option report_client_info '1'
	option hardened_privacy '0'
	option log_queries '0'
	option detect_captive_portals '0'
	option use_hosts '1'
	option cache_max_age '0s'
	option max_ttl '5s'
	option bogus_priv '1'
	option timeout '5s'
	option cache_size '100MB'
	option auto_activate '0'
	option listen ':5053'
	option setup_router '1'
	list config 'xxxxxx'

Resulting (incorrect) nextdns.conf output for dnsmasq:

root@OpenWrt:~# cat /tmp/dnsmasq.d/nextdns.conf
server=#5053
no-resolv
add-mac
add-subnet=32,128

Context

  • Version [e.g. 1.5.2]: 1.5.7
  • Platform [e.g. macOS, ASUS-Merlin]: OpenWRT (snapshot v20)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

DHCP lease parsing is already supported for discovery, but not for resolution. This is something will change, discovery will become a source for local resolution when use-hosts is set.

We’ll also need to add support for dynamic file names. Currently we search for a fix set of known path: https://github.com/nextdns/nextdns/blob/master/discovery/dhcp.go#L18. Does /tmp/hosts/ contains several active files?

Edig: seems like dhcp.cfg01411c is always the file name, so it should be trivial.