From owner-freebsd-questions@freebsd.org Wed Feb 7 10:52:08 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCDCBEF2A49 for ; Wed, 7 Feb 2018 10:52:08 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (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 99D8182ECE for ; Wed, 7 Feb 2018 10:52:08 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from leaf.local (unknown [88.202.132.43]) (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 1E36013BF5 for ; Wed, 7 Feb 2018 10:52:07 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/1E36013BF5; dkim=none; dkim-atps=neutral Subject: Re: FreeBSD jails, dns and ping To: freebsd-questions@freebsd.org References: From: Matthew Seaman Message-ID: <52f596f2-2140-d704-af27-fc2fda53e9ca@FreeBSD.org> Date: Wed, 7 Feb 2018 10:52:06 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 10:52:09 -0000 On 06/02/2018 16:17, James B. Byrne via freebsd-questions wrote: > Note that local_unbound worked with both resolv.conf settings. But > both ping and pkg gave me grief with the first and worked with the > second. > > My understanding, admittedly perfunctory, has been that one is > SUPPOSED to use 127.0.0.1 inside a jail wherever the standard loopback > address is required. And that the jail system takes care of remapping > 127.0.0.1 to whatever address is assigned to the loopback interface > that the jail is configured to use. > > What have I misunderstood? Had I misconfigured something that is > documented otherwise than what I had done? Yes, that is the way it is supposed to work: any attempt to access 127.0.0.1 (possibly 127.0.0.0/8 BICBW) or ::1 is remapped to the jail address. Mostly this works fine, but some applications -- unbound(8) being one of them -- will detect that the packet was sent to 127.0.0.1 but received on a different interface and drop the packet. Your possible solutions are: * Tweak the local_unbound or unbound configuration to use the jail address explicitly. * Investigate VIMAGE jails, which have their own network stacks and consequently a lo0 interface within the jail. Cheers, Matthew