Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The DHCP server on a network I use specifies a DNS server that I do not want to use. Is there a way to continue to use DHCP but to modify the provided information or to "blacklist" one (of the three provided) DNS servers?

The client in question is running Ubuntu 10.04. Networking is managed by NetworkManager but I'm not wedded to that. In fact, I don't like it and wouldn't mind a reason to use something else.

Thanks, Matt.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can manually set your DNS server to whatever you want.

System > Preferences > Network Connections

Click on the network connection in the list and click edit. Then click on the IPv4 Settings tab (if you are using IPv4).

In the drop down list select Automatic (DHCP) addresses only.

Then you can fill in the DNS servers you would like to use in the field below. I think this modifies /etc/resolv.conf.

You'll have to reboot for changes to take effect.

share|improve this answer
    
NetworkManager overwrites resolv.conf every time it starts up. –  mpm Jul 2 '10 at 14:27
    
@mpm That is true. If you use the gui tools to change it from "Automatic (DHCP)" to "Automatic (DHCP) addresses only" as described in my solution, then network manager will only use DHCP for your IP address and will overwrite resolv.conf with the DNS servers that you give it. You should not directly modify resolv.conf. Use the gui tool. –  James T Jul 2 '10 at 17:48
    
Thanks, James. What I really want is a way to use 2 out of the three nameservers from dhcp but specifying them directly is a good enough workaround for the time being. Again, thanks for your help. –  mpm Jul 3 '10 at 0:47
    
@mpm glad i could help... even if it wasn't a perfect fix. –  James T Jul 3 '10 at 7:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.