1

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 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=5.07 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=4.89 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=120 time=4.33 ms

--- 8.8.8.8 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

nameserver 127.0.0.53 
options edns0

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

search station
nameserver 127.0.1.1

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
  • 1
    try to replace the 127.0.1.1 on the resolv.conf to 1.1.1.1 or 8.8.8.8 and save the file, see if that is solving your question.
    – CrazyTux
    Aug 14 at 12:25
  • Thanks @CrazyTux . Yes, 8.8.8.8 works. But 127.0.1.1 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 at 14:08
0

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 192.168.1.1) or you should use some public ones like Cloud's (1.1.1.1) or Google's (8.8.8.8) 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 (127.0.0.1/8) as a DNS server.

2
  • 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 at 8:47
  • I'm glad you solved the issue. I couldn't be of much help but you're welcome Sep 1 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.