1
$ uname -a
Linux pintu 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I am trying to set my DNS resolver to a server I run with my own IP whitelisted. I know this DNS resolver works because I get answers when I dig @64.227.15.172 google.com etc

I also know it works because when I manually edit /etc/resolv.conf and add that IP as a nameserver, I get DNS results from my resolver and everything works fine.

Of course, /etc/resolv.conf doesn't persist any more and since I am using Ubuntu Desktop I was hoping I could configure using the GUI.

The directions are simple (network settings, wifi, ipv4, dns, etc) but when I add my DNS server to the configuration window, it just doesn't work. The details tab doesn't show the change and my DNS results are not coming from my custom server. I've tried logging out/in, restarting wifi, etc.

correct-settings

incorrect-settings

I also tried to edit netplan directly, but was surprised to find the file didn't have any of my network interfaces listed:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
pinhead
  • 111
  • 3

2 Answers2

0

Don't know about the UI, but your netplan file should have something like this:

network:
  version: 2
  ethernets:
    ens50:
      dhcp4: true
      nameservers:
        addresses: [8.8.8.8]

See my answer for more details on working with netplan, and of course, the documentation.

Nagev
  • 674
0

I'm not sure this is the best way and applicable to your situation, but reconnecting network causes to reflect the changed DNS setting in my case.

I just used the toggle button on the Network setting UI, but maybe physically disconnecting a LAN cable might do the trick as well.

catwith
  • 101