Skip to content

Change the dns switching mechanism to NetworkManager backend. #3

@ARS101

Description

@ARS101

Hi.

Not all distribution have systemd-resolved installed by default. E.g. Debian.
However all distributions have nmcli to set DNS.

This is an example of setting the DNS server using nmcli.

nmcli connection modify "<WIFI SSID>" ipv4.dns "<DNS IP 1>,<DNS IP 2>"
nmcli connection modify "<WIFI SSID>" ipv4.ignore-auto-dns "yes"

Also, network needs to be restarted in order to be effective.

nmcli device disconnect <Network Interface>
nmcli device connect <Network Interface>

Note: These aren't the perfect way to implement this change but they demonstrate the point.

I would suggest to change from systemd-resolved to nmcli to maximize portability.
We can also support both backends too, that would be a great idea as well.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions