8

After upgrading from Ubuntu 16.04 to 17.10, the DNS settings doesn't seem to work anymore. I guess that this might have to do something with the migration from resolvconf to systemd-resolv.

How can I make sure that the installed packages and configurations are in default state as intended for 17.10?

For example, I noticed that resolvconf is installed and I removed it. However, this didn't solve the problem. I am guessing that there are more steps to make sure that it's on 17.10 default settings.

I can make it work (temporarily) by explicitly setting a nameserver in /etc/resolv.conf (for example nameserver 8.8.8.8), but this isn't the intended way to do it.

4
  • what about using google dns or opendns?
    – Lynob
    Commented Oct 23, 2017 at 7:01
  • The 8.8.8.8 is the google dns. I tried it as suggested by spark, but it doesn't work.
    – student
    Commented Oct 23, 2017 at 7:06
  • This post seems more complete (both the question and answer): askubuntu.com/questions/966870/… Commented Oct 31, 2017 at 10:24
  • 1
    My 3 least favorite things about ubuntu have all collided -- networkmanager, systemd, and resolv.conf. Yippee...
    – trpt4him
    Commented Nov 8, 2017 at 16:25

6 Answers 6

10

I had the same problems. My DNS stopped working after upgrading from 17.04 to 17.10.

  1. The solution that temporarily worked was putting into /etc/systemd/resolved.conf

    DNS=<DNS server here>
    FallbackDNS=<DNS server here>
    

    and then restarting systemd-resolved by running

    #sudo systemctl restart systemd-resolved
    
  2. The other way is to change in /etc/NetworkManager/NetworkManager.conf

    dns=dnsmasq
    

    to

    dns=systemd-resolved
    

    Then restart NetworkManager by running:

    #sudo systemctl restart NetworkManager
    

and your DNS should work.

1
  • 2
    Thanks, however both methods don't work for me (even after reboot).
    – student
    Commented Oct 23, 2017 at 5:42
2

I found an excellent blog post about the latest Ubuntu's DNS problem with systemd-resolved that solved the issue for me.

The steps are :

  1. add a line nameserver 8.8.8.8 in /etc/resolv.conf
  2. install unbound with sudo apt-get install unbound
  3. disable the troublesome daemon with:

    sudo systemctl disable systemd-resolved

    sudo systemctl stop systemd-resolved

  4. add dns=unbound in the [main] section of /etc/NetworkManager/NetworkManager.conf
  5. enable unbound with:

    sudo systemctl enable unbound-resolvconf

    sudo systemctl enable unbound

  6. Reboot the computer
3
  • But how can you download anything when there is no DBS
    – spark
    Commented Oct 29, 2017 at 8:58
  • 1
    That's the purpose of step 1. It sets up the DNS of Google (8.8.8.8). The problem I had was that the file was overwritten on system boot. Commented Oct 29, 2017 at 10:03
  • Thanks, but that doesn't answer my question. I switched to unbound just after asking this question. The point of this quesiton is of how I reset all DNS related settings to factory default (in particular using systemd-resolved).
    – student
    Commented Oct 31, 2017 at 20:09
2

As @spark said, you must edit /etc/systemd/resolved.conf and after restarting the service, all thing work but you don't see any change in /etc/resolv.conf because systemd-resolved works differently from resolveconf service.

systemd-resolved use an intermediate resolver (127.0.0.53) to pass all requests to DNS servers that you specify in /etc/systemd/resolved.conf DNS section. so you shouldn't change /etc/resolv.conf directly. if you want to check if your changes are affected, you can open /run/systemd/resolve/resolv.conf to see your DNS servers. this is the file that systemd-resolved uses to resolve addresses.

2

Regarding the DNS problem I tried the four "fixes" noted above and none worked. I had lost my eth0 connection when my upgrade crashed with some missing files. I needed to get an Internet connection before I could do anything to fix problem so I tried this using ideas from your Solution 4:

  1. Edit the resolve.conf file by adding line nameserver 8.8.8.8
  2. install unbound with sudo apt-get install unbound

After running 2 above I observed HAD AN INTERNET CONNECTION! Next, I did the following:

  1. sudo apt-get update
  2. sudo apt-get dist-upgrade.

This reloaded the entire UBUNTU 17.10. Then I ran sudo install -f to fix any broken packages. The final result was a working system on my 12-year-old Althon 3500 64-bit machine. ABIT NF-91 mainboard, 2GB ram.

1

Step 1: Checking Default route Use one of these commands:

route -n

or

ip r

Ask a new IP address and amend the connection with the next command:

dhclient -v wlan0
0

I had the same problem after upgrading from 17.04 to 17.10 although for me systemd-resolved was fine.

The problem for me was in/etc/nsswitch.conf.

After commenting out the hosts: files entries DNS worked again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .