You can specify the DNS server for VMs. And you have two choices. One is the configuration of NIC level. Another is
the configuration of VNet level.
- NIC level : https://learn.microsoft.com/en-us/azure/virtual-network/manage-virtual-network#change-dns-servers
- VNet level : https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface#change-dns-servers
Best regards.