Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I edit /etc/resolv.conf, it is overwritten right away with the old configuration. How do I really change the nameserver on Ubuntu Server 9.10?

share|improve this question
up vote 4 down vote accepted

Here is how I do it:

  1. Backup your resolv.conf

    sudo cp /etc/resolv.conf /etc/resolv.conf.auto
    
  2. Edit /etc/dhcp3/dhclient.conf:

    sudo gedit /etc/dhcp3/dhclient.conf
    
  3. If there are any nameservers, write them down for future reference.

  4. Replace the reference line, or add:

    prepend domain-name-servers 1.2.3.4,4.3.2.1;
    
  5. Save and exit!

  6. Restart any Internet clients and services

  7. Test your new settings.

This should work in 9.10 just fine.

share|improve this answer
    
You even knew the DNS server I wanted! Thanks, it worked – Jeffrey Aylesworth Feb 22 '10 at 18:16
5  
that's amazing! that's the same combination i have on my luggage! – quack quixote Feb 22 '10 at 21:49
    
Why did you edit out a working DNS server, for one that doesn't exist? – Jeffrey Aylesworth Feb 24 '10 at 21:06
    
Me? Well I'd figure you already had your own in mind :-\ – Urda Feb 24 '10 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .