Results 1 to 2 of 2

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)

    [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.

    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).
    The first option change permanently the DNS
    The second option change "when you need" the DNS

    Install a simple editor
    Install Scite to simplify and unify the editing for all *ubuntu distros.
    Code:
    sudo apt-get install scite
    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 04:41 PM.

  2. #2
    Join Date
    Dec 2005
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Simple and very Concise, thank you.

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
  •