Solved Host name resolve error in FreeBSD-13.2-i386 jail

Host is 13.2-RELEASE-p4

I have created a 32-bit jail with FreeBSD-13.2-RELEASE-i386. Network seems to work (ping'ing IP addresses and such), but host name lookup doesn't. In my other amd64 jails it works flawlessly.

Here is what I did to create the base:
Code:
# mkdir /jail/bsd-wine32
# cd /jail/bsd-wine32
# fetch http://ftp.freebsd.org/pub/FreeBSD/releases/i386/i386/13.2-RELEASE/base.txz
# tar xpf base.txz

Then I copied resolve.conf from my host into the jail:
Code:
cp /etc/resolve.conf /jail/bsd-wine32/etc/

Then I updated the jail.conf as follows:
Code:
...
bsd-wine32 {
        host.hostname="bsd-wine32.schattenwelt.org";
        ip4.addr="lo1|10.10.0.7/24";
        path="/jail/bsd-wine32";
        mount.devfs;
        devfs_ruleset=10;
        allow.raw_sockets=1;
        exec.clean;
        exec.start="sh /etc/rc";
        exec.stop="sh /etc/rc.shutdown";
        mount.fstab="/jail/bsd-wine32/etc/fstab.jail";
}

Note: I am using pf(4) to route traffic from a loopback device lo1 to my host's network.

Then I started the jail and entered it:
Code:
# service jail onestart bsd-wine32
# jexec bsd-wine32 sh

Commands like pkg update inside the jail all give a host-lookup error, although resolve.conf is there and has the correct content. Ping'ing explicit IP-addresses works, though.

I have another jail that is setup in exactly the same way. The only difference is that that jail uses standard amd64 FreeBSD, whereas my new jail uses i386 FreeBSD.

By the way: My original goal is to start and old Win32 application using the 32-bit version of emulators/wine.

Any ideas?
 
Then I copied resolve.conf from my host into the jail:
Is that really good?
Resolvconf the service will populate /etc/resolv.conf unless you use static IP network where you have to manually populate it.
With DHCP If your network setup is bad resolv.conf will remain empty. Populating resolv.conf does nothing to help.
 
Is that really good?
Resolvconf the service will populate /etc/resolv.conf unless you use static IP network where you have to manually populate it.
With DHCP If your network setup is bad resolv.conf will remain empty. Populating resolv.conf does nothing to help.
Here is the content of resolve.conf (both inside the jail and on the host):
Code:
# Generated by resolvconf
search fritz.box
nameserver 192.168.178.1

I can ping the nameserver 192.168.178.1 from inside the jail. Why is DNS not working? *wonder*

Here is the original output of what I get:
Code:
root@bsd-wine32:/ # 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:13:i386/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:13:i386/quarterly/Latest/pkg.txz: Host does not resolve
Address resolution failed for http://pkg.FreeBSD.org/FreeBSD:13:i386/quarterly.
Consider changing PACKAGESITE.

Fetching http://pkg.FreeBSD.org/FreeBSD:13:i386/quarterly/Latest/pkg.txz on the host works, so the URL is correct.
 
# Generated by resolvconf
search fritz.box
nameserver 192.168.178.1

Studying this more maybe your upstream is not right. Do you have a DNS nameserver on 192.168.178.1?
Mine looks like this:
Code:
# Generated by resolvconf
nameserver 1.1.1.1
nameserver 8.8.4.4
These are actual Internet DNS servers (for the new borg)
 
Well that looks like your upstream router is working ok.

The next concern was pf and lo1. You using pfnat?
Yes, I think so. Here is my pf.conf:
Code:
nat on em0 from {lo1:network} to any -> (em0)
Where em0 is my host's network interface (I didn't bother to use variables or such ...)
 
Studying this more maybe your upstream is not right. Do you have a DNS nameserver on 192.168.178.1?
Mine looks like this:
Code:
# Generated by resolvconf
nameserver 1.1.1.1
nameserver 8.8.4.4
These are actual Internet DNS servers (for the new borg)
I replaced the jail's resolve.conf with your's, but no success.

Again, I can Ping the nameservers 1.1.1.1 and 8.8.4.4., though.
 
You cant force it with DHCP.
Go to your upstream device.
I see fritzbox in search.

What part does fritzbox play in your network?
It has hijacked your network settings or somethings wrong in your setup.

What device is connected to your cable/fiber/whatever modem? Top of your network?
 
You cant force it with DHCP.
Go to your upstream device.
I see fritzbox in search.

What part does fritzbox play in your network?
It has hijacked your network settings or somethings wrong in your setup.

What device is connected to your cable/fiber/whatever modem? Top of your network?
The Fritz!Box is the top of my network. It was provided to me by my ISP.

As I said above: Other jails work just fine. Only difference so far is i386 versus amd64.
 
Code:
# Generated by resolvconf
search fritz.box
nameserver 192.168.178.1

That nameserver just dont look right to me. Should be an actual DNS server.
It is coming from the fritzbox.
My only thought is DNS comes via an DHCP : option.
Maybe something different on i386 DNS options? Sounds really doubtful.

Check natural /etc/resolv.conf nameserver setting on amd64 jails.
Does it use same nameserver?
Maybe a red herring. Is 192.168.178.1 the fritz?
 
Ok. I did the following in my jail.conf:
Code:
    ...
    ip6 = "inherit";
    ip4 = "inherit";
    ...

Then I did a dhclient em0 inside my jail. It overwrote my resolve.conf with the Fritz!Box-values but now DNS works.

So … is this the proper solution?
 
Back
Top