Using Ubuntu 14.04LTS and having a problem with changing DNS. I can change servers in the /etc/resoolvconf/resolv.conf.d/base and head files and restart resolvconf using sudo resolvconf -u and it will update /etc/resolv.conf with the changes I made. I can then dig for a hostname and it tells me its using the servers I just specified. However, when I run nm-tool it still shows some DNS servers that I do not know where they are coming from. This system is not using DHCP, everything is statically configured, but just in case I went into /etc/dhcp/dhclient.conf and added "prepend domain-name-servers 8.8.8.8" thinking this would manually add 8.8.8.8 on top of the DNS servers I see in nm-tool. After all of these changes I restarted networking and still no luck. How can I force nm-tool to use what I specifiy and how do I find out where these other entries are coming from. ?
1 Answer
My /etc/dhcp/dhclient.conf file uses the following configuration, notice the supercede line
# Configuration file for /sbin/dhclient, which is included in Debian's # dhcp3-client package. # # This is a sample configuration file for dhclient. See dhclient.conf's # man page for more information about the syntax of this file # and a more comprehensive list of the parameters understood by # dhclient. # # Normally, if the DHCP server provides reasonable information and does # not leave anything out (like the domain name, for example), then # few changes must be made to this file, if any. # option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; #send host-name "andare.fugue.com"; send host-name = gethostname(); #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; #send dhcp-lease-time 3600; supersede domain-name-servers 208.67.222.222,208.67.220.220,8.8.8.8; # prepend domain-name-servers 208.67.222.222,208.67.220.220; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers, dhcp6.fqdn, dhcp6.sntp-servers; And here is the output of nm-tool which confirms my dns servers
$ nm-tool | awk '/DNS/ {print $2}' 208.67.222.222 208.67.220.220 8.8.8.8 Perhaps what also helps is that in my /etc/NetworkManager/NetworkManager.conf , I have line dns=dnsmasq commented out, so that Network Manager doesn't use the dnsmasq plug-in
In addition to this method, I've also wrote a script to automate updating dns for each and every connection, which is something that can be used as an alternative, but the idea is still the same - ignore dns provided by dhcp, use your own. Details here: https://unix.stackexchange.com/a/164728/85039
- Ok, I have edited my file like you have, restarted the PC, and its still using the DHCP supplied servers.user53029– user530292015-04-14 15:20:34 +00:00Commented Apr 14, 2015 at 15:20
- Weird. I don't know what to tell you.Sergiy Kolodyazhnyy– Sergiy Kolodyazhnyy2015-04-14 15:29:51 +00:00Commented Apr 14, 2015 at 15:29
- yea, it s is. Thank you for the help though..user53029– user530292015-04-14 16:49:02 +00:00Commented Apr 14, 2015 at 16:49
supersede-domain-nameserversline from/etc/dhcp/dhclient.conffile. Pesonally i use that, 14.04 as well