I use dnsmasq to handle nameserver changes by calling different ISP with pppd and usepeerdns option (because wwwoffle can't handle a later change of the nameserver in resolv.conf / see FAQ on the wwwoffle webside). In this configuration the nameserver in /etc/resolv.conf must be fixed on 127.0.0.1. dnsmasq uses /etc/ppp/resolv.conf for the correct nameserver (including polling the file for changes). Now I'm missing a configuration or a perhaps a way of autodetection that in this situation the ip-up script doesn't change the nameservers in /etc/resolv.conf. Reproducible: Always Steps to Reproduce: 1. emerge dnsmasq and pppd 2. configure dnsmasq, pppd and the nameserver 127.0.0.1 in /etc/resolv.conf 3. build up a pppd connection with option USEPEERDNS Actual Results: The dnsmasq daemon isn't used anymore for dns queries, because of the ip-up script changes in /etc/resolv.conf Expected Results: The nameserver in /etc/resolv.conf should still be 127.0.0.1, dnsmasq detects the changes in /etc/ppp/resolv.conf and uses this new nameservers. Perhaps the ip-up script could be changed, so that it doesn't change /etc/resolv.conf if the nameserver there is localhost?
Good idea Michael - feel free to submit a patch.
Created attachment 39729 [details, diff] ip-updown.diff Patch to the ip-up and ip-down scripts for ppp 2.4.2. This is basically what I use so as to not replace the /etc/resolv.conf when using a local nameserver (dnsmasq). Also includes a check for /etc/ppp/resolv.conf which most other distributions have.
quote from pppd man page: usepeerdns Ask the peer for up to 2 DNS server addresses. The addresses supplied by the peer (if any) are passed to the /etc/ppp/ip-up script in the environment variables DNS1 and DNS2, and the environment variable USEPEERDNS will be set to 1. In addition, pppd will create an /etc/ppp/resolv.conf file containing one or two nameserver lines with the address(es) supplied by the peer. I don't see why we should refuse to use peer DNS when someone has 127.0.0.1 as nameserver in its original resolv.conf. If user decided to use it, why denying its right to do so?