0

I was trying to change the Google DNS servers to OpenDNS in my resolv.conf file and accidentally added them incorrectly. Now my resolv.conf file looks like this:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222
nameserver 208.67.220.220
208.67.222.222
208.67.220.220

I was able to properly change the Google nameservers to OpenDNS by editing /etc/networking/interfaces but now I have those two OpenDNS IPs at the bottom that I'd like to get rid of, but I can't directly edit this resolv.conf file.

How can I remove those two lines or reset this file?

Thanks!

Nick
  • 197
  • 4
  • 11

1 Answers1

1

Check whether you don't have any servers in /etc/resolvconf/resolv.conf.d/head or any other file in this directory. They often contain unnecessary data added during configuration of resolvconf package.

The head file should only contain a commented-out header.

sam_pan_mariusz
  • 2,133
  • 1
  • 14
  • 15
  • Thanks. I was able to fix it by removing them from `/etc/resolvconf/resolv.conf.d/base`, then running `sudo resolvconf -u` – Nick Jan 16 '16 at 23:02