Hi @ sapir k,
Welcome to Microsoft Q&A Platform.
Azure VMs send all DNS queries—both private and public—to the Azure-provided DNS server at 168.63.129.16, which handles internal VNet name resolution as well as internet (public) DNS resolution inside Azure. These DNS queries do not use your outbound path (NAT Gateway, Azure Firewall, VPN Gateway, Load Balancer, etc.).
If the queried name is private, Azure resolves it using Private DNS Zones or any custom forwarding rules you configure (such as via Azure DNS Private Resolver). If the queried name is public, Azure still resolves it internally, using Azure’s recursive DNS infrastructure—not your public IP and not your outbound components.
Only after the VM receives the resolved public IP does the actual outbound connection follow your configured egress path (NAT Gateway, Firewall, Load Balancer, UDR → VPN/ER, etc.).
Ref: Azure-provided name resolution and Azure IP address 168.63.129.16
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.