Skip site navigation (1)Skip section navigation (2)
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>
In-Reply-To: <569E12B2.5090302@freebsd.org>
References:  <569e05b6.2RStkLc7SZIg/dVM%perryh@pluto.rain.com> <569E12B2.5090302@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Seaman <matthew@freebsd.org> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?569eeb77.GFz8dwXgj3CL44SN%perryh>