From owner-freebsd-net@freebsd.org Mon Aug 21 13:04:04 2017 Return-Path: Delivered-To: freebsd-net@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 53533DDA11F for ; Mon, 21 Aug 2017 13:04:04 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id B67726EC6C for ; Mon, 21 Aug 2017 13:04:02 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) X-Virus-Scanned: by clamd daemon 0.98.5_1 for FreeBSD at relay2.tomsk.ru Received: from [212.73.125.240] (HELO admin.sibptus.transneft.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 39792352; Mon, 21 Aug 2017 18:59:22 +0600 Received: from admin.sibptus.transneft.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.transneft.ru (8.15.2/8.15.2) with ESMTP id v7LD3vOo047074; Mon, 21 Aug 2017 20:03:59 +0700 (+07) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.transneft.ru (8.15.2/8.15.2/Submit) id v7LD3sBW047073; Mon, 21 Aug 2017 20:03:54 +0700 (+07) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.transneft.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Mon, 21 Aug 2017 20:03:54 +0700 From: Victor Sudakov To: Bert Kiers Cc: freebsd-net@freebsd.org Subject: Re: resolv.conf and a non-standard port Message-ID: <20170821130354.GA46955@admin.sibptus.transneft.ru> References: <20170821102354.GA44676@admin.sibptus.transneft.ru> <5e2bb578-a9c7-93fa-f144-d0a4302cb28c@xs4all.net> <20170821110400.GA45463@admin.sibptus.transneft.ru> <569ac975-0f5c-131a-a236-67cff377ef6c@xs4all.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <569ac975-0f5c-131a-a236-67cff377ef6c@xs4all.net> Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2017 13:04:04 -0000 Bert Kiers wrote: > >> > >>> How can I configure the resolver to use a DNS server with a > >>> non-standard port? > >>> > >>> I have a host running an authoritative-only server (nsd) for the > >>> world, and I want to run local unbound for the host itself (can't use > >>> nsd for recursive queries). > >>> > >>> Unbound can listen on a non-standard port, but how do I configure the > >>> host to use the DNS server at 127.0.0.1:5353 ? > >> > >> I think it will be more simple to have nsd and unbound listen on > >> different IP-adresses, like unbound on 127.0.0.1 and nsd on the external > >> IP-address. Then put 127.0.0.1 in resolv.conf > > > > That's how I have configured it now, but this solution has a major > > drawback: you need to specify the IP address explicitely in > > /var/unbound/unbound.conf which can be inconvenient in some > > situations. > > > > So it's a workaround, but by no means "more simple." > > What happens when you let unbound listen on 127.0.0.1 and nsd on * > (a.k.a. 0.0.0.0)? That may work because 127.0.0.1 is more specific. > Maybe the startup order of the daemons is important then. # sockstat -l | grep unbo unbound unbound 448 3 udp4 127.0.0.1:53 *:* unbound unbound 448 4 tcp4 127.0.0.1:53 *:* unbound unbound 448 5 stream /var/run/local_unbound.ctl # service nsd start [2017-08-21 20:01:16.335] nsd[56380]: notice: nsd starting (NSD 4.1.17) [2017-08-21 20:01:16.336] nsd[56380]: error: can't bind udp socket: Address already in use [2017-08-21 20:01:16.336] nsd[56380]: error: server initialization failed, nsd could not be started -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN AS43859