NETCONFIG_DNS_STATIC_SERVERS don't add a nameserver in the list in /etc/resolv.conf

Greetings !!
I’ve solved that long time before I had to change my computer loosing all the settings.

I set NETCONFIG_DNS_STATIC_SERVERS= to three nameservers but in /etc/resolv.conf I only have the ones given by my ISP thru DHCP :{

I have no way to modify this list at the router side :{


NETCONFIG_DNS_FORWARDER="resolver"
NETCONFIG_DNS_STATIC_SERVERS="192.168.0.3 62.197.111.140 109.88.203.3"
/etc/resolv.conf
search dezordi.world
nameserver 62.197.111.140
nameserver 109.88.203.3

…one nameserver is missing and it is important in my network/domain :{

Hi
If your using wicked, then define them via YaST Network Settings, if using NetworkManager, in the profile (I normally create and give a name), under the ipv4 tab, define then here as a comma delimited list eg;


192.168.0.3, 62.197.111.140, 109.88.203.3

yes it works but the order is inverted :{
i need options rotate to be set up but I don’t know where to specify it…

I though NETCONFIG_DNS_RESOLVER_OPTIONS directive wes the one but it failed :{ nothing in /etc/resolv.conf looks as the /etc/sysconfig/network/config file said :{

Oh ! NETCONFIG_DNS_RESOLVER_SORTLIST would be nice to edit in the correct order of the nameservers !!

nope :{

options rotate
sortlist 192.168.0.3 62.197.111.140 109.88.203.3 
search dezordi.world
nameserver 62.197.111.140
nameserver 109.88.203.3
nameserver 192.168.0.3

192.168.0.3 MUST be the first in the list

I got

sirius:/datas1/exemples # nslookup antares.dezordi.world 
Server:         62.197.111.140
Address:        62.197.111.140#53

** server can't find antares.dezordi.world: NXDOMAIN

…and I must have


sirius:/datas1/exemples # nslookup antares.dezordi.world 
Server:         192.168.0.3
Address:        192.168.0.3#53

Name:   antares.dezordi.world
Address: 192.168.0.3

…if I manually set 192.168.0.3 at first in the list of nameservers…

Hi
So what’s in your /etc/nsswitch.conf file? If it’s such an issue, just put it in /etc/hosts file…


192.168.0.3 antares.dezordi.world antares

Read “man 8 netconfig”, NETCONFIG_…_POLICY. Default is to use static list only as fallback if NetworkManager is used.

NETCONFIG_DNS_STATIC_SERVERS=“192.168.0.3 62.197.111.140 109.88.203.3”

/etc/resolv.conf
search dezordi.world
nameserver 62.197.111.140
nameserver 109.88.203.3

Assuming the only static nameserver you need is 192.168.0.3, the following should do it:

NETCONFIG_DNS_POLICY="STATIC * NetworkManager"
NETCONFIG_DNS_STATIC_SERVERS="192.168.0.3"

You also have more fine grained control over priority with NETCONFIG_DNS_RANKING.

Sorry for the lateness of my reaction, I got lotta things to do and I’m a little overwhelmed…

The solution using NetworkManager (it works with wicked with another setting)

Adding

[global-dns-domain-*]
servers=192.168.0.3,109.88.203.3,62.197.111.140

in the NetwotkManager.conf file than restart the service, this time I got

sirius:/etc/NetworkManager # more /etc/resolv.conf

options rotate timeout:5
search dezordi.world
nameserver 192.168.0.3
nameserver 109.88.203.3
nameserver 62.197.111.140

Other solution with the modification of two files, when you are using a laptop that is about to be connected to several different WiFI:Wired connexions…

In /etc/NetworkManager/NetworkManager.conf:

[main]
plugins=keyfile
dns=default
rc-manager=file
dhcp=dhclient

[connectivity]
uri=http://conncheck.opensuse.org

[ifupdown]
managed=true

In /etc/dhclient.conf:

prepend domain-name-servers <Your DNS here or 127.0.0.1>;
require subnet-mask, domain-name-servers;

…if you want to be sure nslookup will succeed everytime with a “personnal” or “enterprise” DNS that may not forward the requests… in …/system-connexions


[ipv4]
dns-options=attempts:1;rotate;timeout:1;
method=auto

To the @OP,
Why did you use the command “search?”
Did you find that somewhere, and where?

To troubleshoot name resolution issues, the utilities normally used are “dig” and “nslookup.”
The former is probably more hard core linux, the nslookup command is more modern and intuitive.

TSU

Are you referring to the ‘search’ directive in the OP’s posted resolv.conf? That is a legit option (one I use for specifying domain names explicity)

From ‘man resolv.conf’…

search Search list for host-name lookup.
The search list is normally determined from the local domain name; by default, it contains only the local domain name.
This may be changed by listing the desired domain search path following the search keyword with spaces or tabs separat-
ing the names. Resolver queries having fewer than ndots dots (default is 1) in them will be attempted using each compo-
nent of the search path in turn until a match is found. For environments with multiple subdomains please read options
ndots:n below to avoid man-in-the-middle attacks and unnecessary traffic for the root-dns-servers. Note that this
process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and
that queries will time out if no server is available for one of the domains.

          The search list is currently limited to six domains with a total of 256 characters.