Hello @Shaik Althaf ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you have an Azure DNS zone with both private DNS & public DNS records, and you would like to know what the ideal way is to separate private DNS & public DNS zones.
If your requirement is to have the same name for both public and private DNS, then you can go for split-horizon technique.
Split-horizon DNS support: With Azure DNS, you can create zones with the same name that resolve to different answers from within a virtual network and from the public internet. A typical scenario for split-horizon DNS is to provide a dedicated version of a service for use inside your virtual network.
Refer: https://learn.microsoft.com/en-us/azure/dns/private-dns-overview#benefits
You can have a public DNS zone called contoso.com
to register the public IPs of your VMs/resources as DNS records within the zone.
And then also create a private DNS zone called contoso.com
, with the auto-registration feature enabled for your linked Virtual network, so that it can automatically register the VMs as A records into the Private Zone, pointing to their private IPs.
This way, when an internet client does a DNS query for your VM's DNS, Azure will return the public IP record from the public zone. If the same DNS query is issued from another VM in the same virtual network, Azure will return the Private IP record from the private zone.
https://learn.microsoft.com/en-us/azure/dns/private-dns-autoregistration
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.