Fantastic. Thank you very much for your comments. This makes things a lot clearer.
I conclude from what you wrote that: - Adding DNS server ip addresses to /tmp/resolv.conf by adding them to the DNS_SERVER variable at the top of the /etc/init.d/dnsmasq script is useless - they will never be read or used. - If DNS servers are added as dns option to the /etc/config/network, they are added to the /tmp/resolv.conf.auto before the DNS servers discovered byt /etc/init.d/network script. - Therefore, if I write a script that runs after /etc/init.d/network, adds a few DNS servers at the end of /tmp/resolv.conf.auto before /etc/init.d/dnsmasq is started, then my scenario could be accommodated. Right? On 14 September 2010 23:13, Jo-Philipp Wich <x...@subsignal.org> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi. > > > Here my questions: > > Why are there two files /tmp/resolv.conf and /tmp/resolv.auto? > > To separate the config between user or dhcp/pppd provided ns servers and > local ns config. > > > Are they both used or is one of them ignored? If /tmp/resolv.conf is > ignored > > (at least with default config in /etc/config/dhcp, why is it even created > by > > dnsmasq? > > The /etc/resolv.conf (a.k.a. /tmp/resolv.conf) is only used by the local > system. The file points it to the local cache. The resolv.conf.auto > tells dnsmasq the upstream servers and is only read by dnsmasq. > > > Is the nameserver 127.0.0.1 entry in /tmp/resolv.conf required for the > > system to read the /etc/hosts file or is that read anyway if options > domain > > and local have been set in /etc/config/dhcp? > > Its required for the system to do DNS through the local dnsmasq so that > it has the same "view" on DNS as a local client would have. /etc/hosts > is both read by dnsmasq and the local system. > > > Is a dns entry in the interface section of /etc/config/network with one > or > > more dns server IP addresses enough to force static usage of these dns > > servers for this interface, or is some configuration in /etc/config/dhcp > > required? > > The "dns" option in interface is enough. Previous OpenWrt versions had > trouble overriding the DNS server for certain protocols (ppp/pppoe/3g in > particular). > > > Consider a scenario where you want to use the DNS servers the system > > identifies first through upstream discovery, and then, if none is found > or > > the found ones do not work, fall back to some standard given ones (say in > > /etc/config/network with a dns config entry). Is this achievable through > > configuration only? > > I am not sure. Servers are written in the order they're received, so a > locally configured NS is there before, say, DHCP is even started. > > > > > If the strictorder directive is not set in /etc/config/dhcp, what order > will > > dnsmasq use for its dns servers? > > Quoting the dnsmasq man page: > "By default, dnsmasq will send queries to any of the upstream servers it > knows about and tries to favour servers that are known to be up. Setting > this flag forces dnsmasq to try each query with each server strictly in > the order they appear in /etc/resolv.conf" > > > > ~ Jow > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkyPTlEACgkQdputYINPTPPT+ACeMKhp6gldkwUj7H21Nu5brWaI > ENEAmgI5tMn87b5uIksdp3g8XERoVqHi > =pXOA > -----END PGP SIGNATURE----- > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel >
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel