how to config dns in NetworkManager
tags: learning networking linux
content
- in
/etc/resolv.confit says# Generated by NetworkManager - that means, manually changing
/etc/resolv.confwill be pointless, it will get overwritten by NetworkManager
per connection config
to see NetworkManager’s config on this:
nmcli deviceshows all devicesnmcli connection showshows all connectionsnmcli connection show $CONNECTION_NAMEto show details of a connection| grep dnsto see dns info, it matches what it shows resolv.conf
to modify:
nmcli connection modify <connection-name> ipv4.dns "8.8.8.8 1.1.1.1"
nmcli connection modify <connection-name> ipv4.ignore-auto-dns yes
nmcli connection up <connection-name>