From owner-freebsd-questions@freebsd.org Wed Jan 20 02:15:28 2016 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 BAF33A89126 for ; Wed, 20 Jan 2016 02:15:28 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34491D66 for ; Wed, 20 Jan 2016 02:15:28 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id u0K2AX6N083485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 19 Jan 2016 18:10:36 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id u0K2AWo6083484 for freebsd-questions@freebsd.org; Tue, 19 Jan 2016 18:10:32 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA03769; Tue, 19 Jan 16 18:05:53 PST Date: Tue, 19 Jan 2016 18:05:43 -0800 From: perryh@pluto.rain.com (Perry Hutchison) To: freebsd-questions@freebsd.org Subject: Re: resolver not working in a chroot Message-Id: <569eeb77.GFz8dwXgj3CL44SN%perryh@pluto.rain.com> References: <569e05b6.2RStkLc7SZIg/dVM%perryh@pluto.rain.com> <569E12B2.5090302@freebsd.org> In-Reply-To: <569E12B2.5090302@freebsd.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2016 02:15:28 -0000 Matthew Seaman wrote: > On 01/19/16 09:45, Perry Hutchison wrote: > > The resolver is not working in a chroot (to the 10.2 memstick image, > > with its /tmp, /var/run, and /var/tmp made writable by mounting tmpfs > > on them): > > # chroot -u 0 -g 0 -G 105,0,5,20,25 /mnt ping pkg.FreeBSD.org > > ping: cannot resolve pkg.FreeBSD.org: Host name lookup failure > > but it works when not in a chroot: > > # ping pkg.FreeBSD.org > > PING pkg.FreeBSD.org (96.47.72.71): 56 data bytes > > 64 bytes from 96.47.72.71: icmp_seq=0 ttl=51 time=97.329 ms > > ... > > What would cause this? > > You've mounted the 10.2 memstick image on /mnt? Yes. > Do you have a devfs mounted inside the chroot? Try running: > > # mount -t devfs devfs /mnt/dev > > and then try your chroot'ed command again. Interesting to see > if that helps. The mount command worked -- there's now a devfs in the chroot environment -- but it didn't help. I still get the same error. I also tried running "mount -t devfs devfs /dev" in the chroot (after unmounting /mnt/dev), and that didn't help either. There must be some difference in the lookup mechanisms between the resolver and host(1), since host(1) works in the chroot.