# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53

This solution worked somewhat, host and nslookup commands resolve names properly, but wget and browsers are not
– FireSporeNov 11 '17 at 5:39

1

this is correct ...the current bug is that the link to /etc/resolv.conf comes from /run/systemd/resolve/stub-resolv.conf which is bollox it should be /run/systemd/resolve/resolv.confnote that /etc/resolv.conf doesn't really exist in either case
– Mr HeelisApr 29 '19 at 22:37

@FireSpore: does ping work then? host and nslookup resolve host names differently from ping or wget. You may need to look into /etc/nsswitch.conf for a solutioin.
– HongboZhuJun 24 '19 at 12:21

2

Instead of reboot it worked for me to do service systemd-resolved restart && sudo systemctl restart networking
– Ben MaresJan 13 at 16:59

systemd is so broken. DHCP tells the host what DNS should be, (and a bunch of other network settings) you should not have to change any files on the host for this to work.
– teknopaulNov 8 '17 at 22:55

4

Does not look optimal, you will have to do this every time you change DNS server/network
– VictorFeb 14 '18 at 21:23

1

You would need to reconfigure every time the DNS IP's changes (for instance on different networks).
– VictorFeb 14 '18 at 23:40

i just used this and it fixed the problem on my laptop at home, but some time in the future when I am out of my home network I can see that it will cause problems, because the primary and secondary dns server will still be my home servers with their lan addresses.

I put together a script that works around the issue of Netplan not currently supporting the ability to supersede DHCP supplied DNS servers and domain search order. It creates the Netplan yaml file and configures systemd-resolved to work as expected.

systemd-resolved is smart, but, unconfigured as it is, by package maintainers, it just LOOKS stupid because package maintainers do not believe in A Reasonable Default. We can put 13 internet root servers in there aka "djb way", or 10 opennic servers: https://pastebin.com/JBfYVVtG or the three fastest opennic servers, as measured by namebench. Plus ISP nameservers, sure. Plus Google, sure. systemd-resolved is not the problem. I am the problem.

Though you probably don't want to edit a file /usr/lib - those will likely be overwritten on package upgrade. I think a corresponding file somewhere in /etc/systemd is the way to go (it already should have an /etc/systemd/resolved.conf ready to be edited by admins).
– OlorinJan 23 '19 at 4:16

1

man resolved.conf.d, with the d, yes /etc/systemd/resolved.d is the place. I'm noticing that we often have to mkdir /etc/[path].d. bob@laptop l /etc/systemd/resolved.conf.d ls: cannot access '/etc/systemd/resolved.conf.d': No such file or directory
– BobDoddsJan 23 '19 at 4:20

I have the same problem. Each reboot, nothing will resolve. I've uninstalled everything and reinstalled it about 50 times already. It's simply just broken.

so the fix is.... "just apply a few settings each time you boot your pc, which allows 90% of host names to resolve but wget and apt-get updates and upgrades will fail randomly for no reason"

cat /etc/systemd/resolved.conf

# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details
[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=yes
#MulticastDNS=yes
#DNSSEC=no
#Cache=yes
#DNSStubListener=udp

When using Ubuntu 17.10 Desktop, you have to edit the one file that says DO NOT EDIT THIS FILE BLAH BLAH BLAH

well that's the ONLY way it works~!

root@nas:~# cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 8.8.8.8

So remove the 127.0.0.53 IP as the name server and enter another one, google for example. It appears my actual DNS IP address doesn't resolve host names either (even though it works on 10 other machines and devices in the house), but google's works fine.