1

I want to change that address to a more private and secure DNS server. I added it just to connect to the internet and be able to install my updates, now since it's a read-only file I can't directly change it using the vim editor. What are my options? To add the DNS address I executed:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null

The process can be found in the post here as well: apt-get update fails to fetch files, “Temporary failure resolving …” error

dessert
  • 39,982
  • My bad, I'm new to Ubuntu. Guess wasn't smart enough to think of that ;) – Alireza Azimi May 16 '19 at 19:08
  • You started using Ubuntu so must be a smart guy :) do not worry keep experimenting and asking questions, that is what Tesla and Darwin did. – Marc May 17 '19 at 05:04

1 Answers1

2

You need to be admin to change the file. Use:

sudo vim /etc/resolvconf/resolv.conf.d/base

ps there are better ways to add a DNS number.

You can do that on the standard Ubuntu desktop. Click on the network icon. If wire connection its called Wired connection. Click wired settings. Now click on the little settings icon Right next to the on/off button of the connection. You see the DNS settings there. Go to the IPv4 TAB and there is a blank line called DNS. Fill in the new DNS and press the Apply button.

Now turn of the connection and turn it on again with the big red on/off button.

Voila the DNS is added as can be seen in the connection settings where the new ip is added to the list of DNS addresses.

If you only want to use your own DNS and not the ones you received from your ISP set the on/off button next to the DNS setting in the IPv4 TAB to off. Press Apply, turn the connection off and on again and voila only your dns is used.

Marc
  • 339
  • 1
    I believe I have administrator privileges. I'm more concerned with security reasons, that's why I need to use a private DNS server. Please do elaborate on the better method. – Alireza Azimi May 16 '19 at 19:05
  • As u used sudo to implement the change you will need sudo to get it out too. – Marc May 16 '19 at 19:08
  • what do you mean by getting it out? – Alireza Azimi May 16 '19 at 19:09
  • do you mean exiting the editor? – Alireza Azimi May 16 '19 at 19:11
  • 1
    No i mean that you need to use sudo (admin rights) to access the file. As admin the file was edited and you need to edit it again as admin. – Marc May 16 '19 at 19:17
  • And to add or manipulate the DNS you can do that in the standard GUI. Go to settings of the connection and add the DNS ip in the blank line reserved for it. Restart your connection and voila the DNS is added. – Marc May 16 '19 at 19:19