Results 1 to 7 of 7

Thread: Need to change DNS on 12.04

  1. #1
    Join Date
    Jan 2008
    Beans
    211

    Need to change DNS on 12.04

    Hey guys

    My ISP has hard wired 2 useless and censored DNS servers into my router.

    and my resolv.conf file always rewrites itself to 192.168.1.1 which is my router.
    This is pretty anoying because 1 It is a near useless DNS server it uses and 2 It keeps logs and sniffs where it is not suppose to.

    So I need to permanently change my DNS to 8.8.8.8 and 8.8.4.4
    as i have few softwares that cache the DNS on startup and then keep using them and the ISP DNS are cripling them.

    The new system in place is too inflexible and can be used for censorship if the user is not much techsavy.

    Please help me with this
    thnak you in advance

  2. #2
    Join Date
    Apr 2006
    Beans
    417

    Re: Need to change DNS on 12.04

    Well there is many things you can do. The DNS is set on the client in the /etc/resolv.conf You can modify it, but the dhcp client in Ubuntu will rewrite it on reboot or reconnect this with what it gets from the dhcp server. I would recommend just changing the DHCP server settings in your router. You can have it just tell the clients to use the new DNS ip (Static DNS) or the cacheing DNS server in your router can also get its updates from a different DNS ip too. I setup my router to be a caching DNS server and to get DNS updates from OpenDNS.



    It does sound like though that may not be an option
    You could also set your IP staticly on your computer and disable DHCP
    Last edited by bakegoodz; July 28th, 2012 at 11:17 PM. Reason: Reread the post

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Need to change DNS on 12.04

    Quote Originally Posted by bakegoodz View Post
    I would recommend just changing the DHCP server settings in your router.
    +1 for router settings, as they will apply to all clients.

    Another alternatives:
    • Set up clients with an static DNS. Check this guide for servers, and this one for desktop clients.
    • Disable DHCP all together on the router, and set up as server for DHCP and DNS caching. 'dnsmasq' can do all that very easily.

    Quote Originally Posted by lordbux View Post
    i have few softwares that cache the DNS on startup and then keep using them and the ISP DNS are cripling them.
    Fortunately, that is not entirely accurate

    Both the OS, and all applications that know are DNS agnostic. That means that every single resolution goes through the rules established (/etc/nsswitch.conf). That means that the moment you switch a DNS entry on /etc/resolv.conf, no one will have memory of the previous one.

    Let us know how it goes.
    Regards.

  4. #4
    Join Date
    Jan 2008
    Beans
    211

    Re: Need to change DNS on 12.04

    Hai guys thank you for the response.

    The first idea of editing the Router wont work as it just shows 2 DNS as labels, and does not allow it to be changed anywhere.

    The issue that i thought was DNS caching was in reality my connection disconnecting and connecting at various intravels. So must have been rewriting the resolv.conf without my knowledge.


    Then i am using 12.04 Precise and in the network client once i reach the connection area, I am unable to edit DNS box as it is greyed out.As Its a Wireless connection I am unable to see the connection when i open connection editor even when it is conencted.

    I tried
    Code:
    sudo network-admin
    and it helped me edit it but again got reset on DHCP.

    And i made a mistake my resolv.conf read as 127.0.0.1 (localhost) but when i go to network settings of localhost i see 192.168.1.1

    This is what is totally confusing me

  5. #5
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,790
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Need to change DNS on 12.04

    Quote Originally Posted by lordbux View Post
    Then i am using 12.04 Precise and in the network client once i reach the connection area, I am unable to edit DNS box as it is greyed out.
    In the method Automatic (DHCP) they are grey out, as it means 'obtain everything from DHCP'.

    You have to change the method to 'Automatic (DHCP) addresses only', so that the DNS Servers field becomes available.

    Regards.

  6. #6
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Need to change DNS on 12.04

    As of 12.04 the resolv.conf is handled differently. If you want to override it manually without using NetworkManager and keep a static value you can create a file in /etc/resolvconf/resolv.conf.d/
    Send tips to: 17raXAGM42vZX21Vcb5HDwq2GMLmVwN4qd

  7. #7
    Join Date
    Apr 2006
    Beans
    417

    Re: Need to change DNS on 12.04

    Wow, nice answer. I edited /etc/resolvconf/resolv.conf.d/head and it copied its self to /etc/resolv.conf.

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
  •