Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] NetworkManager does not set my custom DNS (Read 6141 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: NetworkManager does not set my custom DNS

Reply #15
And now inexplicably *something* is setting my /etc/machine-id on poweroff/reboot. I'm not sure what could be doing it now. It definitely wasn't there before when I was having the DNS issues though.

I may do more investigating tomorrow. I may rollback or reinstall artix to a different btrfs subvol and see if the problem happens still on a completely fresh install.

Re: NetworkManager does not set my custom DNS

Reply #16
Yes, I did read it.  It is often the case that it works when you run it by hand.  I think the question you have now is why Network manager doesn't do it automatically, or do you consider the issue solved now?
I think you may have misunderstood here btw. I mean I modified the networkmanager connection profile using nmcli to set the ipv4.dhcp-client-id to 01:<mac addr>. But in any case, the right fix is setting machine-id.

Re: NetworkManager does not set my custom DNS

Reply #17
If you don't want NetworkManager to control DNS, set the following in /etc/NetworkManager/NetworkManager.conf :

Code: [Select]
[main]
dns=none

If you want want to know more, look at: 
Code: [Select]
$ man 5 NetworkManager.conf

Re: NetworkManager does not set my custom DNS

Reply #18
Thanks for the tip. I'm fine with networkmanager controlling my DNS now that it is being set correctly.

Re: NetworkManager does not set my custom DNS

Reply #19
Is moving the thread something I need to do or does a mod need to do it?
Sorry, this post might feel a bit disjointed. It's getting late here.

I think I found the problem, same as this person's: https://forum.artixlinux.org/index.php/topic,701.msg5433.html#msg5433

When I set my dbus machine-id, networkmanager sets the ipv4 dns correctly without my setting the dhcp client id. It isnt' automatically setting it to the 01:<mac address>, it's still not set like it did without machine-id. My best guess is that it is trying to talk to dhclient over dbus and it can't without the machine-id being set.

For whatever reason the dbus install scripts don't set /etc/machine-id or /var/lib/dbus/machine-id. dbus-uuidgen > /etc/machine-id. I had a similar problem with KDE plasma a week ago but I must have accidentally reverted that fix at some point.

So I guess the real question is, why isn't the dbus machine-id getting set? I think this is the answer: https://www.reddit.com/r/archlinux/comments/6kwt61/systemd_doesnt_create_machineid_during/

Sounds like normally the machine-id is set by systemd-firstboot according to the arch folks. If that's really the case, I would think folk who migrated arch linux would not have this issue, but since I installed it fresh from the artix livecd mine isnt' set.

And btw I confirmed, that ipv6 in my resolv.conf was my router's ipv6 on my lan. Going back to my example websites I used in the first post, google.com can resolve with "ping -6" but asdf.com can't. My ipv6 DNS was working the whole time. Just not ipv4.

In any case, I'm going to mark this as solved, though I'm going to open up another issue about the systemd-firstboot and dbus's machine-id.


DNS really doesn't need anything with machine ids, and has nothing to do with dbus.  Other aspects of Network Manager might need dbus, like wifi firmware identificaation etc etc, but DNS is a TCP/IP client and so is DHCP

Re: NetworkManager does not set my custom DNS

Reply #20
I agree, dns does not directly have anything to do with dbus. But the system components that are managing this don't work when the machine-id isn't set is all I'm saying.

Re: NetworkManager does not set my custom DNS

Reply #21
I went ahead and did my experiment:

I went back to my btrfs snapshot I did after my initial install

I updated it with pacman -Syyu and rebooted.

I changed it from runit to openrc.

I installed networkmanager-openrc and cinnamon.

I checked my /etc/machine-id. It was empty.

I added networkmanager to the default runlevel and rebooted.

I connected to my wifi network.

I checked /etc/resolv.conf. No ipv4 nameserver.

I did "dbus-uuidgen > /etc/machine-id"

I rebooted.

I connected to the network and checked my /etc/resolv.conf again. There was an ipv4 nameserver now pointing to my router.

So a missing machine-id is causing networkmanager to fail to set the ipv4 nameserver in resolv.conf.

I don't think there's anything else to say here. This thread ought to be closed.

Re: NetworkManager does not set my custom DNS

Reply #22
Ok, maybe one more thing to say. I'm looking at network manager's source code here: https://github.com/NetworkManager/NetworkManager/blob/master/src/nm-core-utils.c . It does have references to /etc/machine-id in it. I would have to read a lot more code to be certain, but it seems probable that the code that generates the dhcp client id fails if /etc/machine-id is empty.

 

Re: [SOLVED] NetworkManager does not set my custom DNS

Reply #23
Replied to the wrong thread. Please forgive my error.