"Authentication is required to set DNS servers" on system startup

Title says it, there’s nothing to add. Annoying as hell :joy: Here it is:

UPD: the issue was caused by nekoray

Can you provide any additional information as to what the setup is that resulted in this?
Thanks

2 Likes

There is quite a lot of information missing. To cause this error, one poisibility is to run resolvectl dns br0 1.1.1.1 or something similar, perhaps from some shell script we don’t know about.

1 Like

Well, I have nekoray in autostart, but I don’t think it is the actual cause since it used to be there while the message wasn’t popping up

Assuming you understand the related security risks, here’s a way to skip password authentication for altering DNS:

sudo tee /etc/polkit-1/rules.d/10-custom.rules << EOF > /dev/null
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.resolve1.set-dns-servers"
&& subject.isInGroup("wheel")) {
return polkit.Result.YES;
}});
EOF
sudo systemctl restart polkit.service
1 Like

Heya, Vladik, can you explain me why that frick even happens in the first place? What could theoretically be the cause?

It is just the result of an unprivileged process trying to perform a privileged operation. If you don’t want to get that prompt, you need to move whatever command is generating it from your user env to the system env. For example, sudo mv ~/.config/systemd/user/my-dns-script.service /etc/systemd/system/my-dns-script.service. But you haven’t told us enough about how you’ve configured your system for us to give you an accurate answer.

1 Like

And how do I find and change this command?

There is a “Details” button on that popup dialog. Does that reveal what script is trying to set the DNS servers?

The button is shown on the screen, it is in its expanded state


I have no idea how to work with that information and what I am supposed to do to achieve my goal

Assuming that link doesn’t tell you any more about what is transpiring, that is very little to go on. :confused:

I would try running systemctl --user status in a terminal window while that dialog is present to see if there is a process waiting for your response that might be the culprit. That, or check the system logs.

Didn’t seem to work


Still asks for authentication at startup.
It was nekoray after all that asked for permission. I don’t want to run it as root at startup or mess with non-user systemd config anyhow, I’d rather enable my user to be able to perform some privileged actions

Is your user part of the wheel group?

yup

You can verify the config by running a command similar to this one:
"Authentication is required to set DNS servers" on system startup - #3 by vekruse

If the issue persists, try omitting the group membership check.

Na-ah


even with the condition removed

It looks like mismatched parentheses.

1 Like

Check the logs, try permissive SELinux mode.
OTOH, the issue may be specific to Kinoite.
The config works for me in F42 Workstation.

where?

polkit.addRule(function(action, subject) {
if ((action.id == “org.freedesktop.resolve1.set-domains” || action.id == “org.freedesktop.resolve1.set-dns-servers”)
{
return polkit.Result.YES;
}
});

What logs and how do I check them?