Add DNS server via resolv.conf in Ubuntu 12.04

As we know Ubuntu 12.04 use resolvconf(a set of scripts and hooks) instead of resolv.conf to manage DNS server.Below steps will show you how to disable resolvconf and re-enable /etc/resolv.conf in Ubuntu 12.04.

If you just want to add a static DNS server in Ubuntu 12.04 ,it’s recommended to refer Set DNS server in Ubuntu 12.04

1.Open a terminal by pressing CTL+ALT+t

2.By default /etc/resolv.conf is a link file of /etc/resolvconf/resolv.conf,so let remove this link

sudo rm -f /etc/resolv.conf

3.Create /etc/resolv.conf as a regular file and add your DNS servers to this file.We add Google DNS server and to resolv.conf as example.

sudo gedit /etc/resolv.conf

4.You are done,you can verify your new DNS server now.Eg:


One thought on “Add DNS server via resolv.conf in Ubuntu 12.04

  1. physical education

    My spouse and I stumbled over here by a different web
    address and thought I may as well check things out. I like
    what I see so i am just following you. Look forward to
    looking over your web page yet again.


Leave a Reply

Your email address will not be published. Required fields are marked *