Thank you for reaching out and apologies for the delayed response here.
I understand you wish to resolve Azure resources from your client machine via the P2S VPN Gateway.
The solution tried above will not work in this scenario as IP address 168.63.129.16 because only internal Azure platform can source a message from this IP address. So, in your scenario above you will also have to deploy a custom DNS server is Azure for the name resolution to work.
Instead of deploying a custom DNS server the recommended solution in this case is to deploy an Azure Private resolver. This service enables you to query Azure DNS private zones from an on-premises environment and vice versa without deploying VM based DNS servers.
Azure DNS Private Resolver provides the following benefits:
- Fully managed: Built-in high availability, zone redundancy.
- Cost reduction: Reduce operating costs and run at a fraction of the price of traditional IaaS solutions.
You can refer to the following tutorial to implement this scenario.
This is how the traffic flow will be when an on-premises server issues a DNS request.
Hope this helps! Please let me know if you have any additional questions. Thank you!