4

I'm running Xubuntu…

$ cat /etc/issue
Ubuntu 17.04

$ uname -a
Linux intrepid 4.10.0-33-generic #37-Ubuntu SMP Fri Aug 11 10:55:28 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

…and connecting through wireless network.

However, the DNS system is acting weird and it fails to resolve domain names occasionally.

When I'm trying to resolve some domain name manually it gives me the following error:

$ nslookup google.com
Server:     127.0.0.53
Address:    127.0.0.53#53

** server can't find google.com: REFUSED

Here's the list of all DNS servers configured on my computer:

$ nmcli device show wlp3s0 | grep IP4.DNS
IP4.DNS[1]:                             192.168.1.1
IP4.DNS[2]:                             8.8.4.4
IP4.DNS[3]:                             8.8.8.8

But, when I try to resolve the domain name and tell it to use my router as a DNS server directly (which should be used automatically in the first place) it works flawlessly:

$ nslookup google.com - 192.168.1.1
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:   google.com
Address: 173.194.122.238
…

Why does it fail to resolve the domain names? What server is it trying to use by default?

My resolve.conf is looking like this:

$ cat /etc/resolv.conf 
# 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

Any hints would be highly appreciated, thanks!


And here's the output of $ systemd-resolve --status. The interface I'm using is wlp3s0.

  • Is your router configured as a firewall to block DNS requests? – Charles Green Sep 3 '17 at 1:25
  • @CharlesGreen It has SPI firewall enabled, but I can't see any settings related to DNS. Also, if it was the case then manual lookup through router's DNS should also be blocked, right? – Slava Fomin II Sep 3 '17 at 4:43
  • Did you run systemd-resolve --status as suggested in the resolv.conf file? What is the output? Add that to your question. – Thomas Sep 3 '17 at 11:25
  • If you use your router's DNS, then a seperate server within the router issues another call to the internet for DNS. Please try to configure your router to allow port 53, for both TCP and UDP connections outbound from your network. – Charles Green Sep 3 '17 at 21:23
  • 3
    I have this issue too, after a session to a VPN network, it seems like the local DNS service (on 127.0.0.53) still tries to resolve the hostnames for which the DNS server in the VPN network is authoritative to that DNS server inside the VPN network and that doesn't work anymore after a disconnect. It should try another DNS server as provided via another network interface. A permanent workaround that I use is: mv /etc/resolv.conf /etc/resolv.conf_orig ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf This makes me suspect that this is due to a bug in systemd-resolved – jringoot Dec 17 '17 at 14:20
1

i did what @jringoot suggested in his comment:
mv /etc/resolv.conf /etc/resolv.conf_orig
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
which basically copies the original resolv.conf file and creates another one.

I examined it and it showed it was still using router dns.
so then I opened the file
vim /etc/resolv.conf
and edited the nameserver from the router dns to 1.1.1.1 (CloudFlare DNS)
i.e. fill it with: nameserver 1.1.1.1

when i do a check using
nslookup google.com
it now shows it is using my specified DNS:
nslookup google.com
Server: 1.1.1.1
Address: 1.1.1.1#53

Non-authoritative answer:
Name: google.com
Address: 172.217.160.14

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.