Changing DNS servers on BuZz's distros

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Changing DNS servers on BuZz's distros

Post by gegs »

Does anyone know an easy way to change the default DNS servers on Xubuntu or Mint? I googled and RTFM'd for a couple of hours and still couldn't find a solution.

I want to retain DHCP but change the default DNS server IP addresses. I can (theoretically) do this using network manager but the 'save' button is greyed out. I'm not sure what the network manager application is called but I tried 'sudo network-manager' to run it as superuser - no dice!

This is so easy to do in Windows (and on my Apple TV, Xbox 360, net-enabled Blu-Ray player etc.) Not so with Ubuntu and its variants.
Max
Posts: 30
Joined: Thu Jul 14, 2011 5:48 pm

Re: Changing DNS servers on BuZz's distros

Post by Max »

Is it not the standard Unix way of editing /etc/resolv.conf ?

i.e

nameserver 8.8.8.8

You'll probably want to "sudo root" beforehand (its a while since I used ubuntu).

Max.
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: Changing DNS servers on BuZz's distros

Post by BuZz »

shouldnt be greyed out on network manager. did you disconnect first before pressing save, or not miss out any fields in the manual config ?
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Changing DNS servers on BuZz's distros

Post by gegs »

@BuZz - I didn't disconnect first; I'll give that a go. It wasn't necessary on my other devices (just a restart after changes) so I didn't think about doing it with Xubuntu.

@Max - I think the /etc/resolv.conf file is re-written on re-boot, at least that's what I read in some Ubuntu forums (I haven't checked whether it's true).
Max
Posts: 30
Joined: Thu Jul 14, 2011 5:48 pm

Re: Changing DNS servers on BuZz's distros

Post by Max »

It probably does. I only have one ubuntu box which runs xbmc and I de-ubuntufied it years ago.

Anyway try this:

Edit /etc/dhcp3/dhclient.conf

and change:

supersede domain-name "yourdomain.com"

prepend domain-name-server 8.8.8.8, 8.8.8.4

Max.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Changing DNS servers on BuZz's distros

Post by gegs »

Thanks Max. I'll try the 'disconnect and use network manager' method first, just to see if it works and because it's easy to change settings back again if needs be. If that doesn't work, I'll try your method.

The reason I want to change the DNS servers is to use UnoDNS. It allows access to geo-locked sites and would allow me to use, for example, the Hulu addon in XBMC. I've done this on the Apple TV and it works well; it maintains bandwith, unlike VPN, is pretty cheap and will work on all net-enabled devices. Having said that, there are security implications to running through somebody else's DNS servers, so I would only consider using it on devices without access to sensitive information.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Changing DNS servers on BuZz's distros

Post by gegs »

I disconnected and tried again but the save button was still greyed out; then I managed to fix it quite simply.

Other devices I'd changed DNS on required an address in the format XXX.XXX.XXX.XXX - If any of the four number sets had only 2 digits I had to prepend it with a zero. I thought I should also do this in Xubuntu but this was making it fail and the save button was greyed out. When I removed the leading zeroes from the DNS address it worked immediately.

Duh!
Post Reply