Solved Hostname resolution inside a jail

I haven't used jails for some time, but decided to create one today.

Setting it went ok and I was able to ping 8.8.8.8 from within it, but am unable to resolve hostname.

Can anyone suggest what I have overlooked?
 
Last edited:
Thanks, that works fine. I was wondering how to do that automatically when creating a jail and came across:-


which says:-

Configuration in the jail​

The file /etc/make.conf on the host possibly already lists make options to set and unset when building software, so it may be a good idea to copy this file to the jail.

host# cp -p /etc/make.conf /srv/jail/www/fs/etc/
The file /etc/resolv.conf should also be copied to the jail, so that it knows which DNS servers to use.

host# cp -p /etc/resolv.conf /srv/jail/www/fs/etc/
If resolv.conf contains a nameserver address 127.0.0.1, you should delete that in the jail, or replace the IP address with the IP address of your external network interface.
 
Back
Top