Change dns nameserver - Ubuntu 9.10

1

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?

Jeffrey Aylesworth

Posted 2010-02-22T18:00:52.037

Reputation: 2 170

Answers

4

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.

Urda

Posted 2010-02-22T18:00:52.037

Reputation: 843

You even knew the DNS server I wanted! Thanks, it worked – Jeffrey Aylesworth – 2010-02-22T18:16:17.910

5that's amazing! that's the same combination i have on my luggage! – quack quixote – 2010-02-22T21:49:37.487

Why did you edit out a working DNS server, for one that doesn't exist? – Jeffrey Aylesworth – 2010-02-24T21:06:50.667

Me? Well I'd figure you already had your own in mind :-\ – Urda – 2010-02-24T21:51:17.423