Name resolution fails inside the chrooted environment

Created:

2016-11-16 13:21:34 UTC

Modified:

2017-08-16 16:20:17 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Name resolution fails inside the chrooted environment

Applicable to:

  • Plesk 11.x for Linux

Symptoms

Network utilities (such as ping, wget, curl etc.) may not work in the chrooted environment. For example it is not possible to get name resolution from the shell using any of the available tools :

bash-4.2$ ping google.com
ping: unknown host google.com

But ping with IP address works fine:

bash-4.2$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=41 time=200 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=41 time=75.7 ms

The shell access type for system user is specified in the Web Hosting Access section.

Cause

There are no libraries in the chrooted environment such as libnss_files.so.2 and libnss_dns.so.2 which are necessary for name service switch (NSS).

Resolution

Copy required libraries to the chrooted environment:

# cp /lib/x86_64-linux-gnu/libnss_files.so.2 /var/www/vhosts/example.com/lib/libnss_files.so.2
# cp /lib/x86_64-linux-gnu/libnss_dns.so.2 /var/www/vhosts/example.com/lib/libnss_dns.so.2

If your operating system is 32bit you should copy these libraries from:

/lib/i386-linux-gnu/libnss_files.so.2
/lib/i386-linux-gnu/libnss_dns.so.2
Have more questions? Submit a request
Please sign in to leave a comment.