Results 1 to 8 of 8

Thread: localhost as dns server?

  1. #1
    Join Date
    Mar 2009
    Location
    Brasilia - Brazil
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question localhost as dns server?

    After upgrading my desktop to Ubuntu 12.04 Precise Pangolin I observed that, though I have configured my network connection (cable Ethernet) including a primary DNS server address, which hapens to be my ADSL router to the Internet, I always get my localhost as my DNS server:

    Code:
    ~$ nslookup ubuntuforuns.org
    Server:		127.0.0.1
    Address:	127.0.0.1#53
    
    Non-authoritative answer:
    Name:	ubuntuforuns.org
    Address: 92.242.140.20
    Code:
    ~$ cat /etc/resolv.conf
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 127.0.0.1
    Why doesn't it just uses the nameserver I have specified? Can I tunr off this local service? How?

    I have missed in 12.04 an utility to enable/disable services at boot time, showing all services installed, as there were in previous Ubuntu versions, such as 10.04.

    Thanks for any help.

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: localhost as dns server?

    This is the new way of doing things (resolvconf / dnsmasq) - this page explains it pretty well, I think

    http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/

  3. #3
    Join Date
    Mar 2009
    Location
    Brasilia - Brazil
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: localhost as dns server?

    Thank you for your information steel driver. As my desktop is not part of any VPN, just a simple member of a home network with access to the Internet through an ADSL router, can we do things the old way, switching back to a standard dns client? Can I uninstall resolvconf?
    TIA

  4. #4
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: localhost as dns server?

    Quote Originally Posted by joelgsf View Post
    Thank you for your information steel driver. As my desktop is not part of any VPN, just a simple member of a home network with access to the Internet through an ADSL router, can we do things the old way, switching back to a standard dns client? Can I uninstall resolvconf?
    TIA
    On DHCP configured interfaces you can use the resolvconf package to dynamically configure the use of DNS servers. The thinking is that if you have a mobile host (laptop or some such), the interface configuration might change depending on where you are using the device. But instead, you can also configure the DNS servers statically via /etc/network/interfaces

    I have a Ubuntu 12.04.1 server that I have configured statically while still using the resolvconf package. If you are using the resolvconf package it will look something like this (from my server)
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
            address 192.168.1.5
            netmask 255.255.255.0
            network 192.168.1.0
            broadcast 192.168.1.255
            gateway 192.168.1.1
            # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4
    So if you are statically configuring the interface you can remove resolvconf and use the /etc/resolv.conf file -- or you can leave the resolvconf package in place and just configure DNS in the /etc/network/interfaces file.

    For more information on the resolvconf package see
    Code:
    man resolvconf
    -BAB1

  5. #5
    Join Date
    Mar 2009
    Location
    Brasilia - Brazil
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: localhost as dns server?

    So if you are statically configuring the interface you can remove resolvconf and use the /etc/resolv.conf file -- or you can leave the resolvconf package in place and just configure DNS in the /etc/network/interfaces file.
    This is my case. I am going to remove resolvconf. I like to have full control over my network
    But I believe that when using DHCP this same protocol cares for configuring everything, including DNS servers, is'nt it?
    Many thanks for your information. I am now more confident in removing resolvconf and stoping dnsmasq (what I had already done). Is there any way for removing dnsmasq without removing network-manager?

  6. #6
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: localhost as dns server?

    Quote Originally Posted by joelgsf View Post
    ... Is there any way for removing dnsmasq without removing network-manager?
    I don't know the answer to this one. I have only installed 12.04 Server Edition which has no Network Manager installed. If everything is statically configured why do you have Network Manager itself installed?

    Read the link that @steeldriver has in his post if you don't want to remove Network Manager. I think I would just disable DNSMasq and be done with it.
    Last edited by bab1; October 7th, 2012 at 05:58 PM.
    -BAB1

  7. #7
    Join Date
    Mar 2009
    Location
    Brasilia - Brazil
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: localhost as dns server?

    Ok Bab1, that's just how I'm working now. I need network-manager because sometimes I have to switch to other networks (contingency or testing purposes).
    Anyway, I feel confortable now. Thank you.

  8. #8
    Join Date
    Mar 2005
    Beans
    211

    Re: localhost as dns server?

    Quote Originally Posted by joelgsf View Post
    After upgrading my desktop to Ubuntu 12.04 Precise Pangolin I observed that, though I have configured my network connection (cable Ethernet) including a primary DNS server address, which hapens to be my ADSL router to the Internet, I always get my localhost as my DNS server:

    Code:
    ~$ nslookup ubuntuforuns.org
    Server:		127.0.0.1
    Address:	127.0.0.1#53
    
    Non-authoritative answer:
    Name:	ubuntuforuns.org
    Address: 92.242.140.20
    Code:
    ~$ cat /etc/resolv.conf
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 127.0.0.1
    Why doesn't it just uses the nameserver I have specified?
    Because it is using the local forwarding nameserver instead.

    And the local forwarding nameserver uses the nameserver address you specified.

    Can I turn off this local service?
    Yes

    How?
    By commenting out the line "dns=dnsmasq" in /etc/NetworkManager/NetworkManager.conf.

    The introduction of a local forwarding nameserver is quite orthogonal to the introduction of resolvconf in Ubuntu 12.04.
    Last edited by jdthood; October 29th, 2012 at 09:10 PM. Reason: Typo

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
  •