Cloud-init fails to correctly set dns settings(server and search domain) for Debian 10.x/11.x/12.x/13.x, more details in the cloud-init bug Network: Fail to set DNS server and search domain on Debian12.
This is a known issue with cloud-init and currently there is no resolution.
#!/bin/shif [ x$1 = x"postcustomization" ]; then cat <<EOF > /etc/resolv.confsearch DNS_SEARCH_DOMAINnameserver PRIMARY_DNS_SERVERnameserver SECONDARY_DNS_SERVEREOF echo "Updated /etc/resolv.conf" > /root/post_customization.logfi