Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There's a plenty of advices across the Internet on how to enable DNS in chroot.

The problem is that there's no /lib/libnss* files in the Ubuntu Precise.

I've tried to copy these files from /etc/: hosts, nsswitch.conf, resolv.conf and the entire /lib directory. But DNS is still not working.

Does anyone have a recipe for the recent Ubuntu?

share|improve this question

well... there are two solutions: the first, and most simple one, is to look for the library into /lib64 if present, or eventually using locate libnss to look for it.
The other solution would be to use strace to see where is the system looking for the library and look in the main system for those libraries. :)

share|improve this answer

As a start, this script, once customized, should give you a basis for a chroot.

Just as a caveat for other readers, just read this

PHP-FPM chroot with chdir

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.