Score:0

Ubuntu DNS nameserver

bo flag

I am new to Ubuntu, and i have a ubuntu workstation installed with ubuntu 20.04. I edited the \etc\resolv.config file previously and add nameservers 8.8.8.8 and nameservers 1.1.1.1. Now i need to add 127.0.0.53 to the resolv.config because otherwise internet cannot be accessed.

I tried to manually edit it through and it works for a instance by restoring the internet connection. However, resolv.config get edited automatically even without rebooting. Therefore internet connection breaks down and i cannot install anything. Could anyone provide help to restore the connection.

I tried manually editing the resolv.conf through vim with sudo also but the changes does not persist.

Additional details :- I tried the solution provided by the Gromov but i could not solve the problem. After entering the command ls -l /etc/resolv.conf I got the following output - -rw-r--r-- 1 root root 38 mar 11 07:39 /etc/resolv.conf

ru flag
How are you configuring your network? You should be setting your DNS servers via Netplan or Network Manager and then `resolved` (which LISTENS on 127.0.0.53) will handle DNS caching and relaying to the actual DNS servers.
Mihira Kasun avatar
bo flag
Thank you very much for your response Thomas, could you please provide more instructions on how to do this. The following are the content of the resolv.config file (nameserver 8.8.8.8 nameserver 1.1.1.1) The command that was suggested by Gromov (ls -l /etc/resolv.conf) gives the following output:- (- -rw-r--r-- 1 root root 38 mar 11 07:39 /etc/resolv.conf)
Score:0
ng flag

Ubuntu use systemd-resolved to configure dns-servers.

Make command below:

ls -l /etc/resolv.conf

If your see that this file is symlink to /run/systemd/resolve/stub-resolv.conf, you should configure systemd-resolved config file:

sudo mkdir /etc/systemd/resolved.conf.d/
sudo cp /etc/systemd/resolved.conf /etc/systemd/resolved.conf.d/resolved.conf
sudo nano /etc/systemd/resolved.conf.d/resolved.conf

Change the line which starts with DNS= to your dns-servers and save (ctrl+o, ctrl+x)

Then restart systemd-resolved:

sudo systemctl restart systemd-resolved.service

Also you can try to edit netplan-config and put dns-servers.

Mihira Kasun avatar
bo flag
Thank you very much. I did as mentioned, and these are the results. ( ls -l /etc/resolv.conf) --> gives the following output:(- -rw-r--r-- 1 root root 38 mar 11 07:39 /etc/resolv.conf). Then i add the dns to the /etc/systemd/resolved.conf.d/resolved.conf and restart systemd-resolved and also rebooted. The following are the content of the file [Resolve] DNS=127.0.0.53 #FallbackDNS= #Domains= #LLMNR=no #MulticastDNS=no #DNSSEC=no #DNSOverTLS=no #Cache=no-negative #DNSStubListener=yes #ReadEtcHosts=yes ~ But still the issue persists and name resolving does not work
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.