6
~ $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 18 Sarah
Release:        18
Codename:       sarah
~ $ uname -r
4.4.0-21-generic
~ $ nmcli -v
nmcli tool, version 1.2.0

Connected to wifi network using profile 'Auto JinJiangHotels':

~ $ nmcli device
DEVICE   TYPE      STATE        CONNECTION          
docker0  bridge    connected    docker0             
wlan0    wifi      connected    Auto JinJiangHotels 
eth0     ethernet  unavailable  --                  
eth1     ethernet  unavailable  --                  
lo       loopback  unmanaged    --  

I wanted to change the DNS server due to the default one not being reachable. So I set the ipv4.dns property to 8.8.8.8 .

But now I discovered that dns settings seem to appear twice:

~ $ nmcli connection show Auto\ JinJiangHotels | grep -i dns
ipv4.dns:                               8.8.8.8
ipv4.dns-search:                        
ipv4.dns-options:                       (default)
ipv4.ignore-auto-dns:                   no
ipv6.dns:                               
ipv6.dns-search:                        
ipv6.dns-options:                       (default)
ipv6.ignore-auto-dns:                   no
IP4.DNS[1]:                             210.22.70.3
IP4.DNS[2]:                             210.22.84.3

Question: What is the difference between ipv4.dns and IP4.DNS[*] ?

dns lookup still fails:

~ $ host maps.google.com
;; connection timed out; no servers could be reached

So I assume 8.8.8.8 is still not being used although nmcli con show command shows ipv4.dns being set to 8.8.8.8.

dns lookup works as expected if I specify 8.8.8.8 directly:

~ $ host maps.google.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases: 

maps.google.com has address 216.58.221.110
maps.google.com has IPv6 address 2404:6800:4005:804::200e
  • Setting ipv4.ignore-auto-dns to TRUE does not make any difference. – canochordo Aug 28 '16 at 7:09
  • ~ $ nmcli con modify Auto\ JinJiangHotels ipv4.ignore-auto-dns TRUE – canochordo Aug 28 '16 at 7:12
5

The lower-case properties are properties of your connection... A "connection" is a profile, a bunch of settings that are used during activation of the connection. These are the properties that are set by nmcli connection modify and nm-connection-editor.

The upper-case properties are shown because this connection is currently active on a device. They are properties from the device, that is, the stuff that is currently configured in the system.

The upper case DNS servers were received from DHCP. You can disable that with the ignore-auto-dns.

After you added 8.8.8.8, did you re-activate the connection? When modifying a connection, those changes do not automatically update the device's configuration. You need to do an explicit nmcli connection up or nmcli device reapply for the changes to take effect.

  • nmcli connection up did the job. Thank you! – canochordo Aug 29 '16 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.