Score:0

how to : systemd-resolve writes a bad resolv.conf doesn't read settings

cn flag

This problem is a blocking issue, it does prevent me from using my laptop and accessing internet.

Using Ubuntu 20.04.3 latest update Oct 19th

After the one but last update oct 10th suddenly I had a problem resolving DNS. Before the update my /etc/resolv.conf read :

nameserver 127.0.0.53

In my netmanager settings I had/have entered 2 DNS-Server IP adresses of my ISP : 1xx.2xx.xxx.21 1xx.2xx.xxx.22

the result of command

$ ls -al /etc/resolv.conf

lrwxrwxrwx 1 root root 32 okt 13 14:10 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf

So I did

$ sudo rm -f /etc/resolv.conf

$ sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

Only to find it didn't change anything : the content of new /etc/resolv.conf after restarting the systemd-resolve service still reads

nameserver ::1

I managed to complete the updates by repeatedly saving manually an /etc/resolv.conf file and overwriting the file written by the systemd-resolve service (workaround). to make certain that people don't doubt my capacity to read : I DO understand the warning at the top of the file saying that the file is overwritten regularly.

I manage to maintain a "usable connection" by regularly overwriting the file /run/systemd/resolve/resolv.conf,

nameserver 1xx.2xx.xxx.21

nameserver 1xx.2xx.xxx.22

until i restart the systemd-resolve service and the file is overwritten by resolve and it reverts to

nameserver ::1

I also checked the /run/systemd/resolve/stub-resolv.conf file which has the following content

nameserver 127.0.0.53
options edns0 trust-ad

My question is :

A- How can I make sure that the resolve service writes the correct file content in /etc/resolv.conf = I do understand that this is a sym-link

B- Where is the parameter file that systemd-resolve uses to produce /etc/resolv.conf and /run/systemd/resolve/resolv.conf, because it sure doesn't read the configuration entered in netmanager settings

waltinator avatar
it flag
`/etc/resolv.conf` is managed (part of "`systemd` takes over the world") and shouldn't be edited by the user. Let your `/etc/resolv.conf` remain as `nameserver 127.0.0.53` and read `systemd-dnsmasq dnsmasq`.
chili555 avatar
cn flag
Please edit your question to show the result of the terminal command: `ls -al /etc/resolv.conf`
Derek Giroulle avatar
cn flag
@waltinator you misread *before* the update my /etc/resolv.conf was nameserver 127.0.053 after the update after the update it read nameserver ::1 Please explain what you mean by " read systemd-dnsmasq dnsmasq "
Derek Giroulle avatar
cn flag
@chili555 the result of conmmand ls -al /etc/resolv.conf is nameserver ::1
chili555 avatar
cn flag
I think you misread or mis-typed the command. Please try again.
Derek Giroulle avatar
cn flag
@chili555 lrwxrwxrwx 1 root root 32 okt 13 14:10 /etc/resolv.conf -> /run/systemd/resolve/resolv.conf content of /etc/resolv.conf === # This file is managed by man:systemd-resolved(8). Do not edit. nameserver ::1 === end of content I cut all the comment lines the only active line in /etc/resolve.conf
chili555 avatar
cn flag
Are there any interesting clues or errors if you do: `sudo service systemd-resolved restart` What is the result of: `systemd-resolve --status | grep 'DNS Servers' -A2`
Derek Giroulle avatar
cn flag
@chili555 no error or return from restart the status command returns > DNS Servers: : : 1 > DNS Domain: ~.
waltinator avatar
it flag
Read the results of typing `man systemd-resolve systemd`. Sorry for my mindo (like a typo, but in the mind, not the fingers).
Derek Giroulle avatar
cn flag
@waltinator the man systemd-resolve systemd doesn provide any indactaion on how I tell the systemd-resolve service the IP adresses of the DNS servers of my ISP
waltinator avatar
it flag
Read `man systemd-dnsmasq systemd-dnsmasq.conf dnsmasq.conf`. `dnsmasq` is a forwarding DNS resolver, running on the localhost at `127.0.0.53`. All of the `127.*.*.*` IP addresses belong to localhost.
Derek Giroulle avatar
cn flag
@waltinator I've read DSMASQ man pages, I could do option -2 no DHCP and put my DNS servers in a dnsmasq config file , however according to the man pages in need to put << nameserver 127.0.0.1 >> in resolv.conf , which gets overwritten with <<nameserver ::1 >> which doesn't work
Derek Giroulle avatar
cn flag
@chili555 no error or return from restart of the resolve service; the status you asked for returns 2 lines with follwing content << DNS Servers: : : 1 ; DNS Domain: ~. >>
Derek Giroulle avatar
cn flag
@chili555 and what is the solution you propose? , what did you learn form the command?
Derek Giroulle avatar
cn flag
@waltinator , now that I read the manual for resolve and dnsmasq , what solution should i find there ? what is your solution ?
Derek Giroulle avatar
cn flag
@chili555 Thanks for the comments without providing an answer or solution you have not been of tangible help
Derek Giroulle avatar
cn flag
@waltinator Thanks for the comments without providing an answer or solution you have not been of tangible help
chili555 avatar
cn flag
Correct. I regret that I am unable to solve every question ever posted but I am not. Sorry.
waltinator avatar
it flag
`::1` is the IPv6 address of `localhost`. Have you mistakenly enabled IPv6?
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.