sort order of DNS nameservers in resolv.conf

I am using Leap 42.1 with dnsmasq as local caching server. I am having trouble to have NetworkManager correctly configuring my /etc/resolv.conf.

Here are my sysconfig entries:

$ grep NETCONFIG /etc/sysconfig/network/config
NETCONFIG_MODULES_ORDER=“dns-resolver dns-bind dns-dnsmasq nis ntp-runtime”
NETCONFIG_DNS_POLICY=“auto”
NETCONFIG_DNS_FORWARDER=“dnsmasq”
NETCONFIG_DNS_FORWARDER_FALLBACK=“yes”
NETCONFIG_DNS_STATIC_SEARCHLIST=“localnet”

When the NETCONFIG_DNS_FORWARDER variable is set to “resolver”,

NETCONFIG_DNS_STATIC_SERVERS=“127.0.0.1 8.8.8.80 208.67.220.220”
NETCONFIG_DNS_RANKING=“auto”
NETCONFIG_DNS_RESOLVER_OPTIONS=""
NETCONFIG_DNS_RESOLVER_SORTLIST=“127.0.0.1 8.8.8.80 208.67.220.220”
NETCONFIG_NTP_POLICY=“auto”
NETCONFIG_NTP_STATIC_SERVERS=""
NETCONFIG_NIS_POLICY=“auto”
NETCONFIG_NIS_SETDOMAINNAME=“yes”

the NETCONFIG_NIS_STATIC_DOMAIN and NETCONFIG_NIS_STATIC_SERVERS

variables, e.g.: NETCONFIG_NIS_STATIC_DOMAIN_1=“second”.

NETCONFIG_NIS_STATIC_DOMAIN=""
NETCONFIG_NIS_STATIC_SERVERS=""
NETCONFIG_VERBOSE=“no”
NETCONFIG_FORCE_REPLACE=“no”

$cat /etc/resolv.conf

Generated by NetworkManager

search localnet
nameserver 62.38.0.81
nameserver 8.8.8.8
nameserver 127.0.0.1

The first nameserver is picked up by DHCP from my router. - How can I ensure, that my localhost address stays always on the top of the list?

Many thanks for your suggestions.

Rainer

In your /etc/sysconfig/network/config

Wondering if modifying the module load order as follows might fix your issue

**NETCONFIG****_MODULES_ORDER="dns-resolver **dns-dnsmasq** dns-bind nis ntp-runtime"**

You also have a “NETCONFIG_DNS_RANKING” setting which is set to auto by default. You can “plus” the dnsmasq service or “minus” the BIND DNS module…

# Allows to specify a custom DNS service ranking list, that is which# services provide preferred (e.g. vpn services), and which services
# fallback settings (e.g. avahi).
# Preferred service names have to be prepended with a "+", fallback
# service names with a "-" character. The special default value
# "auto" enables the current build-in service ranking list -- see the
# netconfig(8) manual page -- "none" or "" disables the ranking.
#
NETCONFIG_DNS_RANKING="auto"

TSU