1

Is /etc/resolv.conf a symbolic link? If so, how can one make persistent changes to the DNS?

wjandrea
  • 14,543
yoyo_fun
  • 181

3 Answers3

4

No no no. You don't manually edit /etc/resolv.conf.

To enter your own DNS addresses, go to the Network icon in the top panel, and select Edit Connections. Open the profile for the network where you'd like your own DNS servers defined.

Select the IPv4 tab. Set Automatic (DHCP) addresses only, and a comma-separated list of DNS servers into the DNS servers field.

enter image description here

heynnema
  • 73,937
  • 3
    @thank you for the information but I cannot use any kind of graphic interface. I have to do everything from the command line since I can only connect through ssh to the virtual machine and it is built in a way in which there is no GUI on it. – yoyo_fun Dec 22 '16 at 08:26
  • 1
    @yoyo_fun you should edit your question to include this very important information. – heynnema Dec 22 '16 at 15:16
2

With ls -l /etc/resolv.conf you can see (due to the arrow and the linked file), that it is indeed a symbolic link. For your problem see this solution.

0

I need to install the resolvconf package. It's a very strange case, maybe an install error or Ubuntu bug, but it happens in a fresh install.

Just do:

apt-get install resolvconf

Then:

service resolvconf restart

Or:

/etc/init.d/resolvconf restart

If you need to change de DNS, edit /etc/resolvconf/resolv.conf.d/base and add nameservers as:

nameserver x.x.x.x
nameserver y.y.y.y

Then restart resolvconf.