From owner-freebsd-questions@freebsd.org Thu Apr 20 21:57:39 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9047ED48864 for ; Thu, 20 Apr 2017 21:57:39 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C0B315AE for ; Thu, 20 Apr 2017 21:57:38 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:1c1d:86a1:a200:b700]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 914B83DCF for ; Thu, 20 Apr 2017 21:57:28 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/914B83DCF; dkim=none; dkim-atps=neutral Subject: Re: Strange Name Server Problem To: freebsd-questions@freebsd.org References: From: Matthew Seaman Message-ID: Date: Thu, 20 Apr 2017 22:57:22 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Hu8jRnoGCOwhlOnO3idrW6u4fI8u5ajux" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on smtp.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 21:57:39 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Hu8jRnoGCOwhlOnO3idrW6u4fI8u5ajux Content-Type: multipart/mixed; boundary="2sJUi6Pm0AgQdMv72tNpAk0FDFtehJpM5"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: Subject: Re: Strange Name Server Problem References: In-Reply-To: --2sJUi6Pm0AgQdMv72tNpAk0FDFtehJpM5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 20/04/2017 19:48, Odhiambo Washington wrote: > I have a server running FreeBSD 11.0-STABLE. >=20 > I am a little stumped why my local caching bind instance doesn't answer= > queries. I have then opted to run bind on port 5353 and unbound on port= 53. > I still experience the same problem! >=20 > root@waridi:/usr/local/etc/unbound # sockstat -l | grep named > bind named 50877 20 tcp4 192.168.27.254:5353 *:* > bind named 50877 21 tcp4 127.0.0.1:5353 *:* > bind named 50877 22 tcp4 127.0.0.1:953 *:* > bind named 50877 23 tcp6 ::1:953 *:* > bind named 50877 512 udp4 192.168.27.254:5353 *:* > bind named 50877 513 udp4 192.168.27.254:5353 *:* > bind named 50877 514 udp4 192.168.27.254:5353 *:* > bind named 50877 515 udp4 127.0.0.1:5353 *:* > bind named 50877 516 udp4 127.0.0.1:5353 *:* > bind named 50877 517 udp4 127.0.0.1:5353 *:* > root@waridi:/usr/local/etc/unbound # sockstat -l | grep unb > unbound unbound 51296 3 udp4 127.0.0.1:53 *:* > unbound unbound 51296 4 tcp4 127.0.0.1:53 *:* > unbound unbound 51296 5 udp4 192.168.27.254:53 *:* > unbound unbound 51296 6 tcp4 192.168.27.254:53 *:* > unbound unbound 51296 10 udp4 *:29712 *:* > unbound unbound 51296 11 udp4 *:28511 *:* > unbound unbound 51296 13 udp4 *:35511 *:* > unbound unbound 51296 14 udp4 *:19644 *:* > unbound unbound 51296 15 udp4 *:22549 *:* > unbound unbound 51296 16 udp4 *:30714 *:* > unbound unbound 51296 17 udp4 *:11907 *:* > unbound unbound 51296 18 udp4 *:50834 *:* > root@waridi:/usr/local/etc/unbound # >=20 > Name resolution takes so long because it has to happen via the ISPs DNS= > Servers, which are the 3rd and 4th options in /etc/resolv.conf >=20 > I am actually lost as to where to start looking. >=20 Have you tried turning up the logging levels for each of these programs? You can set them to log every single query -- this is not usually done in production since it slows the server down, but for debugging purposes, it is really useful. How are you generating lookups? It's best to use a tool like dig(1) -- this can query DNS directly and avoid all the added bits of NSS stuff which helps you localise the problem better. Can you tell if either of these programs is attempting to recurse DNS queries for you? You can use tcpdump to capture any port 53 traffic, or else install dnstop which captures DNS traffic in a similar way and displays various statistics about it. Either of these should be able to show you queries being made from your server to the root or other authoritative servers and replies coming back. You'll only tend to see the full sequence the first time you query for something: most of the results will be cached and second and subsequent lookups for the same thing will just be answered out of cache. You can clear the cache by 'rndc flush' or 'unbound-control flush_zone zonename' Another thing to check is what ends up in the cache for either of those recursive servers -- both rndc and unbound-control have options to dump the cache in text format. Is your local unbound cache using the unbound port or the built-in local_unbound service? If it's local unbound, did you run: service local_unbound setup This will process your /etc/resolv.conf and add any nameservers specified there as forwarders in the configuration it generates. Cheers, Matthew --2sJUi6Pm0AgQdMv72tNpAk0FDFtehJpM5-- --Hu8jRnoGCOwhlOnO3idrW6u4fI8u5ajux Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJY+S7IXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATGoYP/0S1/96CYuHDcoduS8B+EvTa /84062aD8W7p5CckJSMdFN4gm8QKFweNk/MXSEcgzl4djgbJyaZMPTMdEg6ALreH xLvlEnPuRLeJA1xwWQEQPp2bSygo6pcN1EaGJtzPkcXXOjoWm2VpAgdvFer0Ist8 kPjxI7H0BimjLAMAWbHmhTE7ZH+B2tt017wi+NnfDVjSKfOYkX2smPhAiyt4Zu3+ 8uNaYB+eUoW7E4yBUZUFcPGK1M1zea243/JSYTrvaNO0sLEsnPwwZ4BgENvVtkEB 0i/BdDZckY2kS0gJsl9jgVPASpb5Dt51/wmrQ7bI1Hlez6Wk3+w+SAAwdc9stpBd NSi7DxPOWyq6nRUybzDF9zP8p4BxyxmoU0HKlH1xRUgFRO9sOoMVPWA9p0CJIevL WnjTpiBOrYOPCWQTCoeGZfyoS9Bf1KhIc6lNw04e+ZMG+PzhVJKFoVoXDNWR6aoi 4JoQyRo0zMS8G8HT9H0grtPrmJS8Tajfeb184LvAZmqzrRLXrsnjYS1LXeX+zLQD Vs87uiKwlcSFpuuOjhSfJk44KJGFPbsnwMNMJ+/Dao4YXKwFDEhtAv5Qvg9SBE0y /WzRAlkmJqGIcFXnJiTmWKpap9cMS009RdK/yO9z8NrMRPgmRXPoitCeoRJyuwqD YVUuRnT0sc+8/nKXDjQk =fk5r -----END PGP SIGNATURE----- --Hu8jRnoGCOwhlOnO3idrW6u4fI8u5ajux--