1) sudo nano /etc/dhcp/dhclient.conf // Change #prepend domain-name-servers line, add the dns you want. Example: prepend domain-name-servers 220.127.116.11, 18.104.22.168; // Remove # so that it isnt a comment 2) sudo chattr -i /etc/resolv.conf/ 3) sudo nano /etc/resolv.conf/ // Change your DNS settings. IMPORTANT NOTE: Dont separate DNS adresses with commas, write nameserver before each adress, like here: nameserver 22.214.171.124 nameserver 126.96.36.199 nameserver 188.8.131.52 nameserver 184.108.40.206 4) sudo chattr +i /etc/resolv.conf/ 5) sudo systemctl restart NetworkManager.service // If it doesnt work use sudo service restart NetworkManager. It isnt that necessary, wont change outcome. /*I dont like people not understandig what they do, heres what you did: You modifided /etc/dhcp/dhclient.conf and added the adresses, Then used chattr -i to set /etc/resolv.conf/ as a writable file, then changed the file again, set /etc/resolv.conf/ as unwritable and restarted Network Manager*/
Here is what the above code is Doing:
1. You are modifying the /etc/dhcp/dhclient.conf file and adding the addresses.
2. Then you are using chattr -i to set /etc/resolv.conf/ as a writable file.
3. Then you are changing the file again.
4. You are setting /etc/resolv.conf/ as unwritable.
5. You are restarting the Network Manager.