resolver not working in a chroot
perryh at pluto.rain.com
Wed Jan 20 02:15:28 UTC 2016
Matthew Seaman <matthew at 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 (220.127.116.11): 56 data bytes
> > 64 bytes from 18.104.22.168: icmp_seq=0 ttl=51 time=97.329 ms
> > ...
> > What would cause this?
> You've mounted the 10.2 memstick image on /mnt?
> 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.
More information about the freebsd-questions