title: Remove DNS from device using `nmcli`
body: <p>I want to remove the DNS currently associated to the device and add a new one using <code>nmcli</code></p>
  <p>So, if I do <code>nmcli device show eth0</code> I can see</p>
  <pre><code>IP4.DNS[1]:                             10.0.2.2
  </code></pre>
  <p>If I do <code>sudo nmcli device modify eth0 ipv4.dns &quot;8.8.8.8&quot;</code>
  then I can see</p>
  <pre><code>IP4.DNS[1]:                             10.0.2.2
  IP4.DNS[2]:                             8.8.8.8
  </code></pre>
  <p>but I want to remove the first one. How can I do it? If i try <code>sudo nmcli device modify eth0 ipv4.dns &quot;&quot;</code> then the second one (<code>8.8.8.8</code>) is removed but the first one is still there.</p>
  <p>My final goal is to set ONLY <code>8.8.8.8</code> (for example...)</p>
  <p><strong>EDIT:</strong></p>
  <p>I am a bit confused between <code>connection</code> and <code>device</code>.</p>
  <p>For example, let's say that I had <code>10.0.2,2</code> and I had <code>8.8.8.8</code> using one of these two commands:</p>
  <p><code>nmcli connection modify netplan-eth0 ipv4.dns 8.8.8.8</code></p>
  <p><code>nmcli device modify eth0 ipv4.dns 8.8.8.8</code></p>
  <p>Because it seems there is a device and then there is a connection bound to it, so I can modify the dns using one of these two commands.</p>
  <p>Now, I can see:</p>
  <p>Using <code>nmcli device show</code> I have in the result</p>
  <pre><code>IP4.DNS[1]:                             10.0.2.2
  IP4.DNS[2]:                             8.8.8.8
  </code></pre>
  <p>but using <code>nmcli connection show netplan-eth0</code> I can see only</p>
  <pre><code>ipv4.dns:                               8.8.8.8
  </code></pre>
  <p>So, my problem now is that I can easily modify the only dns in the connection, that is <code>8.8.8.8</code> using one of the followin command:</p>
  <p><code>nmcli connection modify netplan-eth0 -ipv4.dns 8.8.8.8</code></p>
  <p><code>nmcli device modify eth0 -ipv4.dns 8.8.8.8</code></p>
  <p>BUT, I don't know how to remove the <code>10.0.2.2</code> that is showing only in the <code>device</code> but not in the <code>connection</code>.</p>
  <p>BTW I did not set manually <code>10.0.2.2</code>, I suppose it was taken through <code>dhcp</code>. And for some motivation this dns is bound only to the <code>device</code> but not to the <code>connection</code>.</p>
  <p>With these details the problem should be more clear :)</p>