• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved pkg update issue in jail (no connectivity)



Thanks: 4
Messages: 44

Hi guys,

I have successfully set up jails with ezjail in the past, but for some reason this time it's just not working (on 11.1). I'm sure it's my oversight here or there.
My jail does not have access with the outside world and cannot do a pkg update

Installing the suggest port doesn't work either, as there's no internet connection (telnet from jail doesn't connect either).
Last edited:


Staff member

Thanks: 6,080
Messages: 26,957

You need to enable routing and you need to set up routing or NAT in order for the jail to be able to talk to the outside world.


Active Member

Thanks: 35
Messages: 110

Telnet google.com in jail:
telnet google.com 80
root@webserver:~ # telnet google.com 80
google.com: hostname nor servname provided, or not known
In addition to what SirDice said, it looks like you need to add name servers to your guest, too:
# mv /etc/resolv.conf /etc/resolv.conf.down
# nc -vw 2 freebsd.org 80
nc: getaddrinfo: hostname nor servname provided, or not known
# mv /etc/resolv.conf.down /etc/resolv.conf
# nc -vw 2 freebsd.org 80
Connection to freebsd.org 80 port [tcp/http] succeeded!
# cat /etc/resolv.conf
# Generated by resolvconf
Edit to add: is Google. Using instead of google.com to test network issues allows you to bypass DNS resolving issues to focus on routing and connectivity issues. Then once they're sorted, you can fix DNS.

Also, I prefer to use and freebsd.org instead of feeding the maw of Google.