The DNS assigned by DHCP in Network Manager is erratic. If I use Wicked and assign my own choice of DNS everything works well. How do I set Network Manager to ignore the DHCP assignment and use my choice of DNS?
I am running 13.1. In my /etc/resolv.conf there is documentation on how to configure it there in a way that it is not overruled by netconfig. Now Networkmanager is not netconfig and 13. is not 13.2, but you could:
look in /etc/resolv.conf if the documentation there is at least updated to the usage of wicked;
try what is described there (for netconfig or wicked) to test what Networkmanager does (removing the comment at all).
Thanks for the prompt reply. Following your suggestion I looked at /etc/resolv.conf.
# cat /etc/resolv.conf
### /etc/resolv.conf file autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
# NETCONFIG_DNS_STATIC_SEARCHLIST
# NETCONFIG_DNS_STATIC_SERVERS
# NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
# NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
#
### Please remove (at least) this line when you modify the file!
search site
nameserver 213.150.135.210
nameserver 213.150.135.211
Since I had read elsewhere that changing this file only works until the next boot I followed the suggestion to change /etc/sysconfig/network/config.
Here are the essential changes I made…
# cat /etc/sysconfig/network/config
## Type: string
## Default: "auto"
#
# Defines the DNS merge policy as documented in netconfig(8) manual page.
# Set to "" to disable DNS configuration.
#
NETCONFIG_DNS_POLICY=""
## Type: string
## Default: ""
#
# List of DNS domain names used for host-name lookup.
# It is written as search list into the /etc/resolv.conf file.
#
NETCONFIG_DNS_STATIC_SEARCHLIST="208.67.222.222 8.8.8.8"
## Type: string
## Default: ""
#
# List of DNS nameserver IP addresses to use for host-name lookup.
# When the NETCONFIG_DNS_FORWARDER variable is set to "resolver",
# the name servers are written directly to /etc/resolv.conf.
# Otherwise, the nameserver are written into a forwarder specific
# configuration file and the /etc/resolv.conf does not contain any
# nameservers causing the glibc to use the name server on the local
# machine (the forwarder). See also netconfig(8) manual page.
#
NETCONFIG_DNS_STATIC_SERVERS="208.67.222.222 8.8.8.8"
linux-diei:/home/ion #
But when I re-booted I got…
search site
nameserver 213.150.135.210
nameserver 213.150.135.211
To avoid any “automatics”, you should configure in /etc/resolv.conf what you want to have. And to signal to the “automatics” that you did that manual configuration and thus do not want it to be changed, you should remove all comment lines there.
At least, that is how it workd on 13.1 with netconfig annd I hope it works also on 13.2 and with Networkmanager.
On 2015-08-08 19:06, ionmich wrote:
>
> openSUSE 13.2 64bit KDE 4.14.9
>
> The DNS assigned by DHCP in Network Manager is erratic. If I use Wicked
> and assign my own choice of DNS everything works well. How do I set
> Network Manager to ignore the DHCP assignment and use my choice of DNS?
In NM choose “dhcp address only” or similar words. Then you have to type
the gateway and the dns.
At least this works in 13.1, I don’t have a 13.2 this instant to verify.
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
Yes. Setting NETCONFIG_DNS_POLICY to empty string disables any modification by netconfig so you are left with the previous content of /etc/resolv.conf, whatever it had been before this change. To use static settings you had to set NETCONFIG_DNS_POLICY=STATIC. See man 8 netconfig.
It’s a trick I use frequently when I need to force a particular DNS. However, it is just as simple to delete /etc/resolv.conf completely when finished with it. NM will then recreate it during the next connection process anyway, or just do