Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: [all variants] HowTo set OpenDNS as DNS in DHCP env

  1. #1
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    870
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Talking [all variants] HowTo set OpenDNS as DNS in DHCP env

    Due to the recent vulnerability in the worldwide DNS
    http://www.vnunet.com/vnunet/news/22...tacks-reported
    http://www.doxpara.com/?p=1189
    can be useful to change the DNS provided by your provider and use OpenDNS instead.

    By the moment you can check if your actual DNS are vulnerable:
    http://www.doxpara.com/

    Here is described two ways to do it for DHCP users and without touching the router configuration (for users that have a static IP is pretty straightforward).

    Install a simple editor
    Install Scite to simplify and unify the editing for all *ubuntu distros.
    Code:
    sudo apt-get install scite
    The first option change permanently the DNS
    The second option change the DNS "when you need"


    1) Change DNS permanently
    Edit the dhcp configuration file:
    Code:
    sudo scite /etc/dhcp3/dhclient.conf
    Add this line at the end and save the file:
    Code:
    prepend domain-name-servers 208.67.222.222, 208.67.220.220;
    Reboot your machine.

    Then try a non-existent url like:
    http://seeifthednsischangednow.com
    You should reach an OpenDNS response as search result in the OpenDNS home page... well you are using OpenDNS DNS.

    2 Change DNS when you need
    Create a file in your home:
    Code:
    scite ~/resolv.conf
    Write the DNS IP of OpenDNS and save it:
    Code:
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    Create a file under /usr/bin
    Code:
    sudo scite /usr/bin/dnsrenew
    Write the following and save it
    Code:
    cp ~/resolv.conf /etc/resolv.conf
    /etc/init.d/networking restart
    Then chmod it to create an executable file:
    Code:
    sudo chmod +x /usr/bin/dnsrenew
    Execute the script:
    Code:
    sudo dnsrenew
    Then try a non-existent url like:
    http://seeifthednsischangednow.com

    Now you can use the DNS provided by OpenDNS till the next reboot.

    The Samba fix with OpenDNS (or external DNS)
    If you are using Samba (as supposed to be) and you are using the DNS of OpenDNS (or any external dns), you must change the configuration of Samba in order to be able to browse your LAN; so, edit your configuration file in this way:
    Code:
    sudo scite /etc/samba/smb.conf
    and change the line of the name resolver section in this way:
    Code:
    name resolve order = lmhosts bcast wins host
    Save and close the file
    Then restart Samba:
    Code:
    sudo /etc/init.d/samba restart
    Wait 10/15 minutes and you are able to browse your LAN with the new DNS.

    I write this little HowTo just to use OpenDNS because I appreciate their service, I'm not involved in OpenDNS team.
    Last edited by dentaku65; August 3rd, 2008 at 08:19 PM.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  2. #2
    Join Date
    Jan 2008
    Location
    /dev/null
    Beans
    2,793
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Temporarily stickied. dentaku, check your Pms

  3. #3
    Join Date
    Apr 2006
    Beans
    75
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Thanks.

    Is this easy to be undone when my DNS gets patched? How?

  4. #4
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    870
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Yes it is. If you choose the first option just edit the dhclient.conf
    Code:
    sudo nano /etc/dhcp3/dhclient.conf
    and change this line
    Code:
    prepend domain-name-servers 208.67.222.222, 208.67.220.220;
    with this line
    Code:
    #prepend domain-name-servers 208.67.222.222, 208.67.220.220;
    Reboot your box.

    If you choose second option, just reboot the box.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  5. #5
    Join Date
    Apr 2006
    Beans
    75
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Thanks again!

  6. #6
    Join Date
    Aug 2006
    Location
    Poland
    Beans
    Hidden!

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Also, if you're having your IP changing every day at midnight for example or it changes every time you disconnect and connect your router - here's my tip how to keep OpenDNS up-to-date with our IP.

    First of all, install inadyn :
    Code:
    sudo apt-get install inadyn
    Then, edit /etc/inadyn.conf file :
    Code:
    sudo gedit /etc/inadyn.conf
    Paste there following content :
    Code:
    --username YOURUSERNAME
    --password YOURPASSWORD
    --alias all.dnsomatic.com
    --dyndns_server_name updates.dnsomatic.com
    --dyndns_server_url /nic/update?
    As you can see, it uses www.dnsomatic.com - it's a website related to OpenDNS, so go there and check if you're not registered already. If not, do it ( I haven't got to, I think while registering on opendns.com you're also getting an account on dnsomatic.com ). Then, create a service for your OpenDNS account - remember to set up your network's label ( you may check it on https://www.opendns.com/dashboard/networks/ , it's Home by default ).
    If dnsomatic says your service is not active, press ALT F2 and type in : inadyn
    You won't get any message during this, so go check on dnsomatic again if it's active. You might noticed that inadyn send some information to dnsomatic and opendns about your IP, so that's the job it does. You can add inadyn to your Session as a startup app.

    Sorry for littering your topic, dentaku65 - but I find this usable.

    By the way, shouldn't this topic be moved to Tutorials & Tips section as a HOWTO guide?
    Last edited by andrek; August 3rd, 2008 at 11:04 AM.

  7. #7
    Join Date
    Oct 2005
    Location
    Milano, Italy
    Beans
    870
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Quote Originally Posted by andrek View Post
    As you can see, it uses www.dnsomatic.com - it's a website related to OpenDNS, so go there and check if you're not registered already. If not, do it ( I haven't got to, I think while registering on opendns.com you're also getting an account on dnsomatic.com ). Then, create a service for your OpenDNS account - remember to set up your network's label ( you may check it on https://www.opendns.com/dashboard/networks/ , it's Home by default ).
    If dnsomatic says your service is not active, press ALT F2 and type in : inadyn
    You won't get any message during this, so go check on dnsomatic again if it's active. You might noticed that inadyn send some information to dnsomatic and opendns about your IP, so that's the job it does. You can add inadyn to your Session as a startup app.

    Sorry for littering your topic, dentaku65 - but I find this usable.

    By the way, shouldn't this topic be moved to Tutorials & Tips section as a HOWTO guide?
    Yes, I see, I did'n knew dnsomatic (and is related to no-ip too where I have an account); but if you have more than a machine in your lan you must provide an account for any machine (I think); basically this HowTo consider:
    • A quick way to use OpenDNS
    • Do not change Router Configuration
    • Simplicity (IMHO)


    This HowTO was written for the section of Tutorials but in some way did not respect all the criteria for posting there, anyway the Ubuntu Forum Staff sticked here and invited me to rewrite in the proper way for the Tutorial section.
    ------------------------------------------------
    yep ”short and long URL„
    http://yep.it/
    ------------------------------------------------

  8. #8

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    Moved to Tips and Tutorials.
    Learning is not attained by chance, it must be sought for with ardor and attended to with diligence. Abigail Adams ( 1744 - 1818 ), 1780;

    My blog Poetry and More Free Ubuntu Magazine

  9. #9
    Join Date
    Jul 2008
    Location
    /home/nicholas
    Beans
    207
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    I tried this on my laptop and everything is fine except my speed is still going the same.It starts out fast than goes down to my normal speed and sometimes even slower.I'm trying this by downloading a Xubuntu ISO from the US Mirror.
    EDIT:I also tried changing the DNS in my router configuration but it still won't work.
    Last edited by niccholaspage; August 8th, 2008 at 07:14 PM.

  10. #10
    Join Date
    Jun 2008
    Beans
    33

    Re: [all variants] HowTo set OpenDNS as DNS in DHCP env

    why scite?

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •