Include the below customization script in customization specification and replace DNS_SEARCH_DOMAIN/PRIMARY_DNS_SERVER/SECONDARY_DNS_SERVER with the expected dns settings.
#!/bin/sh if [ x$1 = x"postcustomization" ]; then cat <<EOF > /etc/resolv.conf search DNS_SEARCH_DOMAIN nameserver PRIMARY_DNS_SERVER nameserver SECONDARY_DNS_SERVER EOF echo "Updated /etc/resolv.conf" > /root/post_customization.log fi
The above customization script will be executed and set dns settings correctly during cloud-init based guest customization.