pkg in jail not working

Need help: I have just created a new jail 'ha' with 'iocage' on a new FreeBSD 14.0-REALEASE maschine (metal):
Code:
iocage create -r 14.0-RELEASE --name ha ip4_addr="em0|192.168.1.200/24"
Everything worked as expected.
Now I want to install some packages inside the jail. No chance:

Code:
root@ha:~ # pkg update
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/Latest/pkg.txz: Address family for host not supported
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly.
Consider changing PACKAGESITE.

When I open the URL in a browser I get a 404 - Not Found.
 
Code:
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly/Latest/pkg.txz: Address family for host not supported 
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:14:amd64/quarterly.
Either an IPv4 host only and resolving an IPv6 address or the other way around, IPv6 only and resolving to an IPv4 address. Or some other mismatch with IPv4 and IPv6.
 
Then
Code:
root@ha:~ # drill -4 google.com
or
Code:
root@ha:~ # drill -6 google.com
should work, but both fail from within the jail.
Both work from the host.
 
In case of a static configuration you might have to specify the nameserver in the jails /etc/resolv.conf. My guess is that
Code:
nameserver 192.168.1.1
will work if 192.168.1.1 is the address of your router.
 
In case of a static configuration you might have to specify the nameserver in the jails /etc/resolv.conf. My guess is that
Code:
nameserver 192.168.1.1
will work if 192.168.1.1 is the address of your router.
This is my /etc/resolv.conf. It's the same on host and jail. It works perfectly on host.
Code:
root@ha:~ # cat /etc/resolv.conf
#search domain invalid
nameserver 79.143.183.252
nameserver 79.143.183.251
nameserver 2a02:c205::2:53
nameserver 2a02:c205::1:53
nameserver 8.8.8.8
nameserver 4.4.4.4
 
Those IPv6 addresses are going to fail if the jail is IPv4 only. And it's probably landing there because it cannot reach the first IPv4 addresses in that list. Also note that you can only have 3 nameservers in resolv.conf(5).
 
Those IPv6 addresses are going to fail if the jail is IPv4 only. And it's probably landing there because it cannot reach the first IPv4 addresses in that list. Also note that you can only have 3 nameservers in resolv.conf(5).
Ok. I cleaned up my /etc/resolv.conf on host and jail.
Code:
root@ha:~ # cat /etc/resolv.conf
nameserver 79.143.183.252
nameserver 79.143.183.251
nameserver 8.8.8.8
... but still can't drill from jail (works fine on host).
 
I suspect your jail simply cannot talk to anything outside the host. Sounds like a configuration issue on the host. Something about setting up the iocage networking isn't correct.
 
I hit this problem today, DNS works fine. it is a file. What I did was I manually downloaded pkg and installed it - after it start working normally. That was in 13x Jail and all others were already 14.
 
Back
Top