How to use resolvectl to set your DNS server in Linux
Modern linux distributions use systemd-resolved to manage DNS settings. You can use resolvectl to manage these settings:
You need to know the name of your primary network interface. Use ifconfig to find it.
In this example, we’ll use enp3s0 as the network interface name.
This command will set your primary DNS server to the Cloudflare DNS server (1.1.1.1):
resolvectl_set_dns.sh
sudo resolvectl dns enp3s0 1.1.1.1Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow