0

I am trying to remove the DNS that I have set to 8.8.8.8 previously but cannot seem to see where it gets the DNS from.

In my wired connection I can see the DNS:

enter image description here

Any help would be appreciated.

EDIT: resolv.conf contents:

# 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
search station

EDIT 2: I found out that on the file ```/etc/dhcp/dhclient.conf`` I had the following:

supersede domain-name-servers 8.8.8.8;

which I uncommented and the 8.8.8.8 from my Wire Connection is now gone and has been replaced with 192.168.2.1. After trying your command:

sudo systemd-resolve -i enp4s0 --set-dns=192.168.2.1

I keep getting the error DNS_PROBE_FINISHED_NXDOMAIN occasionally when I try to go to different websites

How do I resolve this from keep appearing as it keeps my productivity low with the need to wait for 5-10 seconds for a website to load?

  • 1
    Is the DNS possibly supplied by a DHCP server? – Kusalananda Nov 29 '19 at 11:07
  • Can you post the content of /etc/resolv.conf? You can do it opening a terminal and writing cat /etc/resolv.conf – balon Nov 29 '19 at 11:32
  • @Kusalananda I don't think so, some time ago I tried adding Google DNS due to a DNS error I was getting in my browser(dns_probe_finished_nxdomain) which I keep getting and I am trying to remove the DNS servers from the connection to see if it helps resolve this issue – stergosz Nov 29 '19 at 14:14
  • @balon I have edited the question with the contents of the resolv.conf file – stergosz Nov 29 '19 at 14:14
  • 192.168.2.1 is a private IP address. Unless you have a DNS in your local network, it won't work. Real DNS have real IP addresses (like 8.8.8.8 (dns.google)). – U. Windl Dec 21 '19 at 18:01
1

resolv.conf indeed contains the DNS-servers that should be used. But ubuntu now uses systemd which provides it's own DNS-server.

127.0.0.53 is (just like 127.0.0.1) your own system, so resolv.conf forces your system to contact it's own (systemd) dns-server. This systemd dns-server will send the requests to 'real' DNS-server(s).

You can change the final dnsserver(s) that systemd uses with:

systemd-resolve -i NETWORKINTERFACE --set-dns=SOMESERVER

Systemd allows you to use different settings for each networkconnection, which is why you also have to specify the network-interface.

Suppose you want to make sure that all dns-requests that are sent out on interface eth0 are being sent to 8.8.8.8, then the command becomes systemd-resolve -i eth0 --set-dns=8.8.8.8.

You can run this command for multiple interfaces if you need to make sure that in all these cases the same dns-server is being used.

See systemd-resolve --status for the current settings and man systemd-resolve for everything there is to know about configuring systemd's DNS-server.

PS: You will probably already know this, but I'll mention it anyway: Replace SOMESERVER by a IP-address instead of a name, because otherwise you would have a circular problem

| improve this answer | |
  • Running systemd-resolve --set-dns=192.168.x.x throws the following error: --set-dns=, --set-domain=, --set-llmnr=, --set-mdns=, --set-dnssec=, --set-nta= and --revert require --interface=. – stergosz Nov 29 '19 at 15:29
  • Sorry, I forgot to mention that you have to specify the network interface with -i INTERFACE, i'll edit my answer – Garo Nov 29 '19 at 15:54
  • A little late on my reply, but I found out that on the file /etc/dhcp/dhclient.conf I had the following: supersede domain-name-servers 8.8.8.8; which I uncommented and the 8.8.8.8 from my Wire Connection is now gone and has been replaced with 192.168.2.1. After trying your command: sudo systemd-resolve -i enp4s0 --set-dns=192.168.2.1 I still get the error DNS_PROBE_FINISHED_NXDOMAIN occasionally when I try to go to different websites – stergosz Dec 16 '19 at 10:39

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.