### set up resolv.conf from host
# ubuntu precise and on, /etc/resolv.conf is a symlink to ../run/resolvconf/resolv.conf
[ -h $lxc_root/etc/resolv.conf ] && rm -f $lxc_root/etc/resolv.conf
- cp /etc/resolv.conf $lxc_root/etc/resolv.conf
+ ### since fedora36, our hosts use systemd-resolved, but the guests can't use that
+ # so the administrator has the option to create /etc/resolv.conf.containers
+ # and if that file exists it will be copied in the containers instead of /etc/resolv.conf
+ if [ -f /etc/resolv.conf.containers ]; then
+ cp /etc/resolv.conf.containers $lxc_root/etc/resolv.conf
+ else
+ cp /etc/resolv.conf $lxc_root/etc/resolv.conf
+ fi
### and /etc/hosts for at least localhost
[ -f $lxc_root/etc/hosts ] || echo "127.0.0.1 localhost localhost.localdomain" > $lxc_root/etc/hosts