I'm having a problem with DNS on Ubuntu 18.04. I think there is a misconfiguration somewhere between netwrok-manager, systemd-resolved and resolvconf.

I can ping IP addresses ok, but not host names:

$ ping -c 3
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=120 time=5.07 ms
64 bytes from icmp_seq=2 ttl=120 time=4.89 ms
64 bytes from icmp_seq=3 ttl=120 time=4.33 ms

--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 4.336/4.768/5.072/0.318 ms

$ ping -c 3 www.google.com
ping: www.google.com: Name or service not known

Both systemd-resolved and resolvconf services are running:

There is a symlink /etc/resolv.conf pointing to /run/systemd/resolve/stub-resolv.conf

options edns0

If I replace /etc/resolv.conf symlink with a file containing the below, hostnames are resolved

search station

I'd like to know how to fix it so it works without having to remove the symlink. Can someone please advise on how to fix this issue?

  • 2
    try to replace the on the resolv.conf to or and save the file, see if that is solving your question.
    – CrazyTux
    Aug 14, 2021 at 12:25
  • Thanks @CrazyTux . Yes, works. But also worked. My issue is if I remove the static file and replace it with the symlink that was originally there then DNS stops working
    – cjt
    Aug 14, 2021 at 14:08

1 Answer 1


The problem is that the DNS server you're using to resolve domain names is not able to resolve the requested domain. When you're using localhost as a DNS server, it might not have your requested domain. So you have to either use your router's DNS settings (change IP that is right next to the namespace keyword to or you should use some public ones like Cloud's ( or Google's ( DNS servers. You can also find other public DNS servers and you can even pay for some of them. Whichever option you go with, it's up to you. But I would not recommend using your local host ( as a DNS server.

  • Thanks @Muhammed Özen . I found there was an underlying issue with a misconfigured virtual network and dnsmasq. Once I removed the virtual network and the dnsmasq entries, it worked as normal
    – cjt
    Sep 1, 2021 at 8:47
  • I'm glad you solved the issue. I couldn't be of much help but you're welcome Sep 1, 2021 at 19:58

You must log in to answer this question.

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