Solved No internet inside Linux Jail

I have Linux jail (debian bookworm ) - created taking steps from handbook ( Thin Jail ) . I can ping 1.1.1.1 and my local ip`s but cant access actual internet ping www.google.com returns Temporary failure in name resolution
My jail .conf file
Code:
debian {
  # STARTUP/LOGGING
  exec.start = "/bin/sh /etc/rc";
  exec.stop = "/bin/sh /etc/rc.shutdown";
  exec.consolelog = "/var/log/jail_console_${name}.log";

  # PERMISSIONS
  allow.raw_sockets;
  exec.clean;
  mount.devfs;
  devfs_ruleset = 4;

  # HOSTNAME/PATH
  host.hostname = "debianBSD";
  path = "/jails/containers/debian";

  # NETWORK
  ip4.addr = 192.168.1.102;
  interface = vtnet0;

  # MOUNT
  mount += "devfs     $path/compat/debian/dev     devfs     rw  0 0";
  mount += "tmpfs     $path/compat/debian/dev/shm tmpfs     rw,size=1g,mode=1777  0 0";
  mount += "fdescfs   $path/compat/debian/dev/fd  fdescfs   rw,linrdlnk 0 0";
  mount += "linprocfs $path/compat/debian/proc    linprocfs rw  0 0";
  mount += "linsysfs  $path/compat/debian/sys     linsysfs  rw  0 0";
  mount += "/tmp      $path/compat/debian/tmp     nullfs    rw  0 0";
  mount += "/home     $path/compat/debian/home    nullfs    rw  0 0";
}


root@debianBSD:~# uname -s -r -m
Linux 5.15.0 x86_64
 
Sounds like a DNS problem, it's possible that you forget to configure /etc/resolv.conf in the jail.
i just cp my resolv.conf file to jail.
This is my /etc/resolv.conf file inside jail ... same on my host OS
Code:
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1111
nameserver 1.1.1.1
nameserver 1.1.1.1

I have another jail ( Thicccc ) runing gitea and internet is fine, same resolv.conf file.
 
Back
Top