[FS#785] dnsmasq: /tmp/resolv.conf not set to localhost when noresolv=1 and resolvfile is unset
LEDE Bugs
lede-bugs at lists.infradead.org
Sun May 14 02:24:14 PDT 2017
A new Flyspray task has been opened. Details are below.
User who did this - Paul Oranje (por)
Attached to Project - LEDE Project
Summary - dnsmasq: /tmp/resolv.conf not set to localhost when noresolv=1 and resolvfile is unset
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Laag
Priority - Normaal
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - For up-stream name resolution dnsmasq normally uses the name servers in the resolvfile, unless noresolv is true (and then a up-stream DNS server should explicitly have been configured).
The file /etc/resolv.conf defines the name servers to be used by processes that run on the router. This file is a soft link to /tmp/resolv.conf.
The dnsmasq init script dnsmasq_start() routine normally writes the file /tmp/resolv.conf and sets the name server to 127.0.0.1; the dnsmasq_stop() routine restores /tmp/resolv.conf to its previous state (being a soft link to /tmp/resolv.conf.auto)
These init script routines execute these steps only when UCI dhcp.dnsmasq.resolvfile equals '/tmp/resolv.conf.auto', but resolvfile only defaults to that value when UCI dhcp.dnsmasq.noresolv is not set to '1'.
Not using the local running DNS service when noresolv is true does not make sence; the semantics of that config value do not imply this.
The latter may typically occur when using unbound as DNS service with dnsmasq as dpcp-link (see unbound documentation).
work-around: explicitly set UCI dhcp.dnsmasq.resolvfile to '/tmp/resolv.conf.auto'.
possible fixes:
Write (and restore) /tmp/resolv.conf also when noresolv is true, e.g. guard it with:
[ "$noreolv" -eq '1' -o "$resolvfile" = "/tmp/resolv.conf.auto" ]
or, probably a better fix, just test if a service runs on 127.0.0.1:53; advise on how to accomplish that are welcome.
More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=785
More information about the lede-bugs
mailing list