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
Suitable for cases where DNS is not taken over or when you want to temporarily modify it even if it is.
Open etc/resolv.conf and modify the nameserver parameter, for example:
text
nameserver 1.1.1.1
nameserver 1.0.0.1
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1001Modify via systemd-resolved
Open etc/systemd/resolved.conf and edit the DNS= parameter, for example:
text
DNS= 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001Run sudo systemctl restart systemd-resolved.service to restart the DNS service.
Modify via resolvconf
Open the resolvconf configuration file.
bash
nano /etc/resolvconf/resolv.conf.d/headEdit the configuration.
text
nameserver 8.8.8.8
nameserver 8.8.4.4Regenerate resolv.conf
bash
sudo resolvconf -uRun the following command to verify the DNS configuration
bash
cat /etc/resolv.conf