If local name servers are configured by resolvconf -a lo we need to
authorRoy Marples <roy@marples.name>
Sat, 30 Oct 2010 13:17:59 +0000 (13:17 +0000)
committerRoy Marples <roy@marples.name>
Sat, 30 Oct 2010 13:17:59 +0000 (13:17 +0000)
respect that.

libc.in
resolvconf.in

diff --git a/libc.in b/libc.in
index 0cc561d76fc0c20387db8f74f682c02d3435aa65..577a2f93e0b372af00471fba42412e7eb218d158 100644 (file)
--- a/libc.in
+++ b/libc.in
@@ -113,7 +113,8 @@ case "${resolv_conf_passthrough:-NO}" in
 *)
        [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
        newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)"
-       newns="$(uniqify $name_servers $NAMESERVERS $name_servers_append)"
+       NS="$LOCALNAMESERVERS $NAMESERVERS"
+       newns="$(uniqify $name_servers $NS $name_servers_append)"
 
        # Hold our new resolv.conf in a variable to save on temporary files
        newconf="# Generated by resolvconf\n"
index 800a02bdac1ee986c1e61a79a5ffe672ce18ecac..3aab4d4263f24248a57b7b4696a5aadd4a9628d4 100644 (file)
@@ -108,11 +108,12 @@ parse_resolv()
        # let our subscribers know about global nameservers
        for n in $name_servers; do
                case "$n" in
-               127.*|0.0.0.0|255.255.255.255|::1) continue;;
-               *) newns="$newns${newns:+ }$n"
+               127.*|0.0.0.0|255.255.255.255|::1) :;;
+               *) newns="$newns${newns:+ }$n";;
                esac
        done
        echo "NAMESERVERS=\"$newns\""
+       echo "LOCALNAMESERVERS="
        newns=
 
        while read line; do
@@ -138,7 +139,10 @@ parse_resolv()
                        ;;
                "nameserver "*)
                        case "${line#* }" in
-                       127.*|0.0.0.0|255.255.255.255|::1) continue;;
+                       127.*|0.0.0.0|255.255.255.255|::1)
+                               echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\""
+                               continue
+                               ;;
                        esac
                        ns="$ns${line#* } "
                        ;;
@@ -266,6 +270,7 @@ make_vars()
        echo "DOMAINS='$newdomains'"
        echo "SEARCH='$(uniqify $SEARCH)'"
        echo "NAMESERVERS='$(uniqify $NAMESERVERS)'"
+       echo "LOCALNAMESERVERS='$(uniqify $LOCALNAMESERVERS)'"
 }
 
 force=false