Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Networking & Wireless
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Networking & Wireless
Having problems getting connected to the internet or getting your wireless card to work? Ask here.

 
Thread Tools Display Modes
Old July 27th, 2007   #1
mirrorhall
First Cup of Ubuntu
 
Join Date: Oct 2005
Beans: 10
Changing DNS to OpenDNS

My ISP DNS Servers keep getting spoofed and i would like to change to OpenDNS. I have a broadband ISP and use a router to log into the PPPoE account (pretty standard).

I would like to tell DHCP to not do DNS and then tell it which servers to use. However, the router will always reset the DNS on renewing their lease. I use dnsmasq to set a local DNS cache (speeds up access to often visited sites) so my first entry is 127.0.0.1, but otherwise the setup is pretty standard.

In gentoo i can go to /etc/conf.d/net and set:

Quote:
config_eth0="dhcp"
dhcpcd_eth0="-t 10"
dhcp_eth0="nodns"
dns_servers_eth0="127.0.0.1 208.67.222.222 208.67.220.220"
How can i do this in Ubuntu so that the change survive rebooting the router?

New to Ubuntu! Obvious isn't it - Loving it so far.
mirrorhall is offline   Reply With Quote
Old July 27th, 2007   #2
dmizer
自己犠牲の精神
 
dmizer's Avatar
 
Join Date: Mar 2006
Location: Kitakyushu Japan
Beans: 7,892
Xubuntu 8.04 Hardy Heron
Re: Changing DNS to OpenDNS

fantastic directions right on opendns ... http://www.opendns.com/start/unix.php under "Using OpenDNS with DHCP"
dmizer is offline   Reply With Quote
Old July 27th, 2007   #3
mirrorhall
First Cup of Ubuntu
 
Join Date: Oct 2005
Beans: 10
Re: Changing DNS to OpenDNS

Quote:
Originally Posted by dmizer View Post
fantastic directions right on opendns ... http://www.opendns.com/start/unix.php under "Using OpenDNS with DHCP"
Thanks, yes. But as I'm new to Ubuntu I'd like to understand how to do this the Debian way. The instructions on the OpenDNS website instruct you to use networking (adjust the DNS servers in the GUI). The problem is this does not survive a router restart.

My question is therefore how do we control DHCP the debian way (on the *.conf command line level or dpkg level?)

1. Tell DHCP not to do DNS (otherwise the router resets the servers on each lease change)
2. Tell DHCP which servers to use for DNS. (redirect to using whichever ones i choose to use)

:: So that the changes are permanent on a router reboot, and "connection information" shows the opendns dns address and not my ISP's.

Last edited by mirrorhall; July 27th, 2007 at 09:42 PM..
mirrorhall is offline   Reply With Quote
Old July 27th, 2007   #4
dmizer
自己犠牲の精神
 
dmizer's Avatar
 
Join Date: Mar 2006
Location: Kitakyushu Japan
Beans: 7,892
Xubuntu 8.04 Hardy Heron
Re: Changing DNS to OpenDNS

no ... under "using opendns with dhcp"

it says this:
Quote:
1) Run: sudo gedit /etc/dhcp3/dhclient.conf

2) Change the prepend line to read:

prepend domain-name-servers 208.67.222.222, 208.67.220.220;

This will prepend the OpenDNS addresses to the top of the list. (You can also use "supersede", which will just use them.) You don't have to worry about the DHCP client overwriting settings on each reboot or lease cycle, and your ISP nameservers will still be used as backup.

3) Run: sudo /etc/init.d/networking restart
dmizer is offline   Reply With Quote
Old July 27th, 2007   #5
dmizer
自己犠牲の精神
 
dmizer's Avatar
 
Join Date: Mar 2006
Location: Kitakyushu Japan
Beans: 7,892
Xubuntu 8.04 Hardy Heron
Re: Changing DNS to OpenDNS

i see ... there's a link for "ubuntu" at the top of the link i sent you.

for the ubuntu specific directions, the command line directions are also listed under: "If your settings get revoked after reboots, or after periods of inactivity, you can try this:"

but they are the same directions as appears under "Using OpenDNS with DHCP" on the same page i linked you to earlier.
dmizer is offline   Reply With Quote
Old July 27th, 2007   #6
mirrorhall
First Cup of Ubuntu
 
Join Date: Oct 2005
Beans: 10
Re: Changing DNS to OpenDNS

Quote:
Originally Posted by dmizer View Post
i see ... there's a link for "ubuntu" at the top of the link i sent you.

for the ubuntu specific directions, the command line directions are also listed under: "If your settings get revoked after reboots, or after periods of inactivity, you can try this:"

but they are the same directions as appears under "Using OpenDNS with DHCP" on the same page i linked you to earlier.
Yes, i saw all that - thanks.

The problem was that these settings were not being remembered on reboot. However i seem to have found my mistake. Adding user to the "dhcp" group and then setting up the networking options in the GUI seems to work.

NOTE:
Add user to group "dhcp" seems to allow Ubuntu to remember DHCP settings.
mirrorhall is offline   Reply With Quote
Old July 28th, 2007   #7
kevdog
I Want My $2!!
 
kevdog's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Beans: 7,077
Ubuntu 8.10 Intrepid Ibex
Re: Changing DNS to OpenDNS

I think using OpenDNS with Samba screws up connecting to other "windows" computers, particularly if you are using winbind to refer to them by name rather than by IP address. Just an FYI if you encounter this in the future. I contact OpenDNS about this, and they wanted me to subscribe to their service to find a solution. I told them to forget it!
kevdog is offline   Reply With Quote
Old July 28th, 2007   #8
dmizer
自己犠牲の精神
 
dmizer's Avatar
 
Join Date: Mar 2006
Location: Kitakyushu Japan
Beans: 7,892
Xubuntu 8.04 Hardy Heron
Re: Changing DNS to OpenDNS

Quote:
Originally Posted by kevdog View Post
I think using OpenDNS with Samba screws up connecting to other "windows" computers, particularly if you are using winbind to refer to them by name rather than by IP address. Just an FYI if you encounter this in the future. I contact OpenDNS about this, and they wanted me to subscribe to their service to find a solution. I told them to forget it!
if you're using wins, configure your nsswitch.conf file's hosts line so that it resolves wins before it resolves dns like so:
Code:
hosts:          files wins dns
then opendns doesn't interfere with your windows network.
dmizer is offline   Reply With Quote
Old July 28th, 2007   #9
kevdog
I Want My $2!!
 
kevdog's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Beans: 7,077
Ubuntu 8.10 Intrepid Ibex
Re: Changing DNS to OpenDNS

Thanks for the tip!!! Why isnt this info just posted on the OpenDNS site? Why would they want to charge me for this??
kevdog is offline   Reply With Quote
Old January 28th, 2008   #10
erfahren
100% Pure Ubuntu
 
erfahren's Avatar
 
Join Date: Jun 2007
Location: Colorado, USA
Beans: 882
Ubuntu 9.10 Karmic Koala
Re: Changing DNS to OpenDNS

just adding links for people serching this topic in the future:
HOWTO get around flaky DNS servers: pointers to some simple methods
Ubuntu Tutorials - How To Setup OpenDNS On Ubuntu
__________________
HP G71 Notebook - 2.20 GHz Intel Core2Duo T6600 - 4GB DDR2 - Intel GMA 4500MHD - Atheros AR9285 802.11b/g/n WiFi Adapter
Be aware of what you enter into the terminal. Ask for clarification if you are unsure what a command does.
erfahren is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:19 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry