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

Thread: DNS issue with query cache

  1. #1
    Join Date
    Dec 2007
    Beans
    88

    DNS issue with query cache

    Hi,

    I have a bind9 dns and have an issue with queries to the DNS.

    The queries from the devices on the same network are using the external IP rather than the internal IP such as 192.168.1.40

    E.g.

    Feb 8 15:28:34 fred named[24143]: client 121.73.xxx.xxx#62178: query (cache) 'www.apple.com/A/IN' denied

    This is a query from 192.168.1.40 but instead the query uses my wan address. I can work around it but my wan is not static.

    Thanks

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

    Re: DNS issue with query cache

    Hi bibble235.

    Could you post the result of this commands from the client?
    Code:
    nslookup ubuntu.com
    
    dig ubuntuforums.org
    
    cat /etc/resolv.conf
    
    grep dnsmasq /etc/NetworkManager/NetworkManager.conf
    
    cat /var/run/nm-dns-dnsmasq.conf
    Regards.

  3. #3
    Join Date
    Dec 2007
    Beans
    88

    Re: DNS issue with query cache

    Here you go,

    bbm lib # nslookup ubuntu.com
    Server: 127.0.1.1
    Address: 127.0.1.1#53

    ** server can't find ubuntu.com: REFUSED

    bbm lib # dig ubuntuforums.org

    ; <<>> DiG 9.8.1-P1 <<>> ubuntuforums.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 9042
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;ubuntuforums.org. IN A

    ;; Query time: 1 msec
    ;; SERVER: 127.0.1.1#53(127.0.1.1)
    ;; WHEN: Fri Feb 8 16:29:29 2013
    ;; MSG SIZE rcvd: 34

    bbm lib # 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.1.1

    # OpenDNS Fallback (configured by Linux Mint in /etc/resolvconf/resolv.conf.d/tail).
    nameserver 208.67.222.222
    nameserver 208.67.220.220
    bbm lib # grep dnsmasq /etc/NetworkManager/NetworkManager.conf
    dns=dnsmasq
    bbm lib # cat /var/run/nm-dns-dnsmasq.conf

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

    Re: DNS issue with query cache

    Thanks.

    There are a couple of unusual settings:
    • You are using the dnsmasq plugin, but instead of looping into 127.0.0.1, you are using 127.0.1.1
    • The file /var/run/nm-dns-dnsmasq.conf should content a line with upstream DNS server, but it seems to be empty. It should something like:
      Code:
      server=192.168.1.1
      Where 192.168.1.1 is the LAN IP of your server running bind.

    I hope that help. Let us know how it goes.
    Regards.

  5. #5
    Join Date
    Mar 2005
    Beans
    211

    Re: DNS issue with query cache

    Quote Originally Posted by papibe View Post
    There are a couple of unusual settings:
    • You are using the dnsmasq plugin, but instead of looping into 127.0.0.1, you are using 127.0.1.1
    That is not unusual. In Ubuntu 12.10 the address 127.0.1.1 is used instead of 127.0.0.1.

    Quote Originally Posted by papibe View Post
    • The file /var/run/nm-dns-dnsmasq.conf should content a line with upstream DNS server, but it seems to be empty. It should something like:
      Code:
      server=192.168.1.1
      Where 192.168.1.1 is the LAN IP of your server running bind.

    I hope that help. Let us know how it goes.
    Regards.
    This is no longer true in Ubuntu 12.10. In Ubuntu 12.10 NetworkManager supplies nameserver addresses to its slave dnsmasq process over D-Bus, not via nm-dns-dnsmasq.conf.

  6. #6
    Join Date
    Mar 2005
    Beans
    211

    Re: DNS issue with query cache

    So the client is using NetworkManager+dnsmasq. To find out what dnsmasq is using as upstream nameservers you have to do a bit more digging. Please post the output of
    Code:
       nmcli -f IP4 dev list | grep DNS
    Ref: http://askubuntu.com/questions/18009.../180174#180174

    I speculate that the client is consulting your LAN's modemrouter which forwards the query to your BIND instance using its WAN address as source address.
    Last edited by jdthood; February 9th, 2013 at 01:29 PM.

  7. #7
    Join Date
    Dec 2007
    Beans
    88

    Re: DNS issue with query cache

    The result is the IP of the router. 192.168.1.2.

    It is incredibly frustrating. All I want to do is use my services e.g mail on my lan at work and at home. I use virtual hosts at work to allow this to work but when I get home they don't resolve to the local ip. Hence the DNS on my local lan.

    Thanks for your reply

  8. #8
    Join Date
    Mar 2005
    Beans
    211

    Re: DNS issue with query cache

    Configure the DHCP server on your router to give out the address of the BIND server, rather than the address of the router, as the address of the DNS nameserver.

  9. #9
    Join Date
    Dec 2007
    Beans
    88

    Re: DNS issue with query cache

    Not too sure how to do this. I have a TD-W8960N

    Manual is at

    http://www.tp-link.com/Resources/doc...User_Guide.pdf

    I can disable DHCP but that is not you have asked I think.

  10. #10
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,633
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: DNS issue with query cache

    Take a look at section 4.4.11 of that manual. I don't know if that will change the DNS server address that DHCP will offer, but you can give it a try.
    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

Page 1 of 2 12 LastLast

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
  •