Results 1 to 9 of 9

Thread: Problems with DNS

  1. #1
    Join Date
    Jun 2011
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Problems with DNS

    Hello everyone,

    I recently registered a domain, and I can't access it from my computer.

    It works fine from every other computer I have, but not my ubuntu laptop.

    My laptop is running 12.04 LTS

    After further invistigation, nslookup seems to query localhost (and return NXDOMAIN - dnsmasq is not installed), whereas my server (ubuntu 10.04 LTS) it queries the correct server given by the routed (server on the same LAN as my laptop).

    nslookup on my laptop:
    Code:
    $ nslookup tyzoid.com
    Server:		127.0.0.1
    Address:	127.0.0.1#53
    
    ** server can't find tyzoid.com: NXDOMAIN
    nslookup on my server:
    Code:
    $ nslookup tyzoid.com
    Server:		75.75.76.76
    Address:	75.75.76.76#53
    
    Non-authoritative answer:
    Name:	tyzoid.com
    Address: 24.11.221.181
    Thanks

    EDIT:
    it works fine if I specify a DNS server to use, ie nslookup tyzoid.com 8.8.8.8, however, I want my laptop to use the DNS server provided by my router.

    EDIT2:
    resolv.conf:
    Code:
    # 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
    search hsd1.mi.comcast.net
    Last edited by tyzoid; December 2nd, 2012 at 08:26 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Problems with DNS

    Did you uninstall dnsmasq? 12.04 and later use a new method for DNS resolution that pretty much requires it. It should be installed by default on any 12.04+ system. That's why resolv.conf points to 127.0.0.1. The expectation is that dnsmasq will be listening on that address.
    Last edited by SeijiSensei; December 2nd, 2012 at 09:34 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jun 2011
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Problems with DNS

    No, I did an upgrade from a previous ubuntu version.

    Edit:
    When installing dnsmasq:
    Code:
    Setting up dnsmasq (2.59-4) ...
     * Starting DNS forwarder and DHCP server dnsmasq                               
    dnsmasq: failed to create listening socket for port 53: Address already in use
                                                                             [fail]
    invoke-rc.d: initscript dnsmasq, action "start" failed.

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Problems with DNS

    Are you running a DNS server on this machine like BIND9? Something is obviously listening on port 53.

    We had some lengthy discussions last spring about the changes made to DNS resolution with 12.04. Take a look at this thread and the suggested fix here.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Jun 2011
    Beans
    16
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Problems with DNS

    Quote Originally Posted by SeijiSensei View Post
    Are you running a DNS server on this machine like BIND9? Something is obviously listening on port 53.

    We had some lengthy discussions last spring about the changes made to DNS resolution with 12.04. Take a look at this thread and the suggested fix here.
    I've seen both threads.

    Yes, I do have bind9 installed, but it was not running (I disabled it from boot). netstat didn't return anything that appeared to be listening to :53

    Yesterday, after installing dnsmasq, it somehow started querying my ISPs server, and I thought it fixed, but following a restart, it is now querying localhost again.

    Edit:
    I've re-tried the method in that thread (as I had recently installed dnsmasq) but to no avail. resolv.conf still shows "nameserver 127.0.0.1".

    Edit2:
    I uninstalled bind9, and restarted network-manager. it now appears to be resolving correctly. I'll post back if the issue comes back, but thank you.
    Last edited by tyzoid; December 4th, 2012 at 12:08 AM.

  6. #6
    Join Date
    Mar 2005
    Beans
    211

    Re: Problems with DNS

    Quote Originally Posted by tyzoid View Post
    I recently registered a domain, and I can't access it from my computer. It works fine from every other computer I have, but not my ubuntu laptop.
    You are running dnsmasq from the dnsmasq package which is a caching forwarding nameserver. You registered a new domain name in upstream DNS but local dnsmasq doesn't know about it yet and continues to report NXDOMAIN.

    The solution is to cause dnsmasq to clear its cache or simply to restart dnsmasq.

    The resolv.conf file you show is correct, given that you are running dnsmasq.

  7. #7
    Join Date
    Mar 2005
    Beans
    211

    Re: Problems with DNS

    Quote Originally Posted by SeijiSensei View Post
    12.04 and later use a new method for DNS resolution that pretty much requires it. It should be installed by default on any 12.04+ system. That's why resolv.conf points to 127.0.0.1. The expectation is that dnsmasq will be listening on that address.
    To be clear. Ubuntu *Desktop* installs the dnsmasq-base package which contains the dnsmasq executable (but not the initscript and other configuration files). This executable is, by default, run by NetworkManager and made to listen on 127.0.0.1 (in Precise) or 127.0.1.1 (in Quantal).

    You are free to uninstall the "dnsmasq" package. It isn't needed unless you want to run the standalone dnsmasq server.

    You can't uninstall dnsmasq-base because network-manager Depends on it.

    However, you can cause NetworkManager not to use the dnsmasq executable as a forwarding nameserver by editing /etc/NetworkManager/NetworkManager.conf and commenting out the line "dns=dnsmasq".

  8. #8
    Join Date
    Mar 2005
    Beans
    211

    Re: Problems with DNS

    Quote Originally Posted by tyzoid View Post
    When installing dnsmasq:
    Code:
    Setting up dnsmasq (2.59-4) ...
     * Starting DNS forwarder and DHCP server dnsmasq                               
    dnsmasq: failed to create listening socket for port 53: Address already in use
                                                                             [fail]
    invoke-rc.d: initscript dnsmasq, action "start" failed.
    This happens because in Precise the standalone dnsmasq server can't be started when the NetworkManager-controlled dnsmasq instance is in use. See bug #959037. This was fixed in Quantal. You can fix it in Precise by disabling the NetworkManager-controlled dnsmasq instance. Edit /etc/NetworkManager/NetworkManager.conf and comment out the line "dns=dnsmasq".

  9. #9
    Join Date
    Mar 2005
    Beans
    211

    Re: Problems with DNS

    Quote Originally Posted by tyzoid View Post
    Yesterday, after installing dnsmasq, it somehow started querying my ISPs server, and I thought it fixed, but following a restart, it is now querying localhost again.
    If you are running standalone dnsmasq (i.e., dnsmasq as started by the "dnsmasq" package) and you have disabled NM-dnsmasq as described earlier then resolving should work correctly and you should see "nameserver 127.0.0.1" in /etc/resolv.conf. Dnsmasq forwards queries to upstream nameservers. Dnsmasq reports which nameservers it is using in /var/log/syslog.

    I uninstalled bind9, and restarted network-manager. it now appears to be resolving correctly. I'll post back if the issue comes back, but thank you.
    If uninstalling bind9 fixed it then you may have been affected by bug #996088.

    https://bugs.launchpad.net/ubuntu/+s...d9/+bug/996088

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
  •