Confirm DNS management program
Run cat /etc/resolv.conf and check the file output for comments like # Generated by resolvconf or # Generated by systemd-resolved.
Directly modify resolv.conf
Use when DNS is not managed, or for temporary changes when it is.
Open etc/resolv.conf and modify the nameserver parameter, for example:
nameserver 1.1.1.1
nameserver 1.0.0.1
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1001
Modify via systemd-resolved
Open etc/systemd/resolved.conf, modify the DNS= parameter, for example:
DNS= 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
Run sudo systemctl restart systemd-resolved.service to restart the DNS service.
Modify via resolvconf
Open the resolvconf configuration file.
nano /etc/resolvconf/resolv.conf.d/head
Edit the configuration.
nameserver 8.8.8.8
nameserver 8.8.4.4
Regenerate resolv.conf
sudo resolvconf -u
Run the following command to verify the DNS configuration
cat /etc/resolv.conf