I have been trying to set my dns to 1.1.1.1 using systemd resolved and networkmanager but it just wont work? I have been trying to troubleshoot it but I lack knowlage on the topic. it did work once but broke down once I rebooted. here are some screenshots of the status.
#[SOLVED] DNS wont work properly, NetworkManager systemd resolved
190 messages · Page 1 of 1 (latest)
I think the problem might be the preset showing disabled and the deamon says no deamon
that really isn’t it
preset disabled is just that it doesn’t start at boot by default, which is standard for almost everything in Arch
can you do resolvectl status? this shows what systemd-resolved is doing
I could also ask if you’ve done anything with /etc/resolv.conf
I havent but might have on accident?
yup, so resolved works
if there’s an issue it’s probably from whatever glue is between it and your applications
makes me happy atleast I couldnd manage that
you could try using wget or curl next
those should reference resolv.conf and hence should also use resolved directly
if it doesn’t we get a lead for troubleshooting
so the problem is in networkmanager?
possibly, maybe
it did work once but broke again when I rebooted
I’m not fully sure just yet
sorry to keep you waiting I need to do smtg first
huh, apparently there’s something weird
in that NetworkManager needs to be started after resolved to use it?
you could try just restarting NetworkManager and see what happens
alright I will do that when I can
thanks a lot
huhhh??
it works now
wait a second im gonna reboot to see if it works again
okay I rebooted now it doesnt work
so, yea
NetworkManager can automatically pick up on systemd-resolved and use it
only if it detects that /etc/resolv.conf symlink
which seems to only work when systemd-resolved is running
so if NetworkManager starts before systemd-resolved it just doesn’t use it
so I just stop and start?
well, the proper way to fix it is to tell NetworkManager to explicitly use systemd-resolved in its config files
so this weird race condition doesn’t happen
from the Arch Wiki
Alright
it says file does not exist
.aw Help/Reading
I really need to learn how to create files using nano
No results found.
hm…
yup, exactly
this explains some common conventions used in the Arch Wiki you may want to be aware of
I mean, hang on
you can just create files using nano
even if it says file doesn’t exist you can write what you want to put in and then save it
Oh I didnt know I cna just make a path using mkdir I thought I needed path to already exist
damn
though really it should be saying [ New File ] in that case
oh, I see
I thought it was just the file that’s missing
but yea just make directories
okayy done
lemme reboot and see if it works
nop
it still wont curl discord.g
yeahh
might that be because its not curling using resolv.conf?
and if so does the restart NetworkManager trick work?
does resolvectl status say anything different now?
no its the same
here is the output again just incase im missing smtg
oh no
it has changed
default route to yes
doesnt work on discord as expected
okay, so
we’re going to get really deep into how systemd-resolved works, because it’s… weird
you’d think setting the global DNS would make every DNS query go through the global servers
and you’d be right… partially
see, systemd-resolved sends queries to every DNS server marked as default route, alongside the global server, in parallel
and this might be causing whatever weirdness here, since resolved is querying cloudflare twice
when NetworkManager is configured to use systemd-resolved, it dumps its own DNS config for systemd-resolved to use
in this case since your NetworkManager is telling systemd-resolved that it’s using Cloudflare’s DNS anyway, you could try just disabling the default one for systemd-resolved
it’ll fall back to only using the NetworkManager one
or you could disable NetworkManager getting DNS servers entirely, which would force usage of the DNS servers you configure in systemd-resolved’s config files
yeah I did change the default to network manager
so get network manager out of the way?
yea
what I do on my laptop is I tell NetworkManager to not get DNS servers and only configure IP addresses
but I do this per network, which is really simple since I can just do it graphically in KDE’s networking settings
I have no idea how to use KDE's networking settings but I do use KDE plasma
it’s just the little network icon in the tray
it has a button that lets you go to the Wi-Fi & Networking page in settings
which lets you configure every network you have with NetworkManager
here?
this is probably less relevant to you since you’re running something with ethernet while I’m on a Wi-Fi only laptop
but yea
I just set ‘Automatic (Only addresses)’ in IPv4 and IPv6
tahts what its set for me
hm, I see
you probably did that to get cloudflare’s servers on NetworkManager probably
you can first comment this out, then reload NetworkManager
and then resolvectl status
hopefully that should get rid of the ethernet link’s DNS servers
oh yeah it does
yet it still wont curl discord.gg
oh wait
it did?
oh no it didnt I mispelled discord with dicord 😭
anyway, our aim is still to get rid of one of those DNS records so we are left with only one
can you see if 1.1.1.1 pops up anywhere in your NetworkManager config files?
you might have put it in the IPv4 section of this also
doesnt seem to be
well, that’s… odd
then check resolvectl status again
the cable?
and how’s resolvectl status now?
um
yikes
okay, well that 1.1.1.1 at the bottom should have disappeared but it didn’t
you could restart both NetworkManager and systemd-resolved at once
also first dns server changed from 1.0.0.1 to 1.1.1.1
and if that 1.1.1.1 still lingers I would say this is cursed
yea, it does that
lol
nope still does not work
wait at once?
yeah no still doesnt wor
I dont get why it worked here tho? it has happened once before too
it just works sometimes and once I reboot goes away
your system is weirdly cursed
I thought the original issue was just the race condition with NetworkManager autodetecting resolv.conf
so the proper solution should’ve been to explicitly configure it and make it not need to autodetect anymore
but we ran into a weirder problem
guess I am gonna try to trouble shoot it more
I mean, I can think of a bodge that can get it working now
namely – get rid of that dns.conf that tells NetworkManager to use systemd-resolved explicitly
and then add a little file that tells systemd to start NetworkManager after systemd-resolved
did we already not do that?
nope, we didn’t
systemd still starts the two independently
I think I mightt have
did you?
yea, so you didn’t do what I described
this might be a little confusing, so
systemd, by itself, is the services manager
it starts all of your programs on system boot
systemd-resolved is a little thing the systemd project made that does stuff with DNS, but it’s not all that related to systemd the service manager
what I was describing is telling systemd, the service manager, to start the NetworkManager service after the systemd-resolved service
is there a manual page for that
yea, systemd.unit
anyway unfortunately I do have to leave this on a bit of a cliffhanger because I need to go
alright thanks for all the help ^w^
fleuriafluoride received a thank you cookie!
... solved
#9742 📣 If there is nothing else that we can do for you, please close this thread by adding "[SOLVED]" to the title.
- You can do this on desktop by clicking the three dots on the top right of the page, and pressing "Edit Post".
- You can also do this on Android / iOS by long tapping your post in the text channel list, and tapping "Edit Post".
Your title should be like so: https://cdn.discordapp.com/attachments/503224329191030787/1039841700417384498/image.png
Thank you
DNS wont work properly, NetworkManager systemd resolved [SOLVED]
[SOLVED] DNS wont work properly, NetworkManager systemd resolved
hey there, sorry for the necromancy.
Im having issues configuring systemd-resolved