Azure Private Link - DNS Zone Setup - azure

I have applications running in two separate VNETs (in same subscription) that need to connect to a third party DB service using Private Link. I have created two private end points specific to each VNET however not sure how to setup the Private DNS Zone. Since the DNS Zone is global, how do I reference the record referencing the db DNS entry? While adding this record , it requires IP for the private end point. In my case I have two private end points.
Appreciate your feedback!

If you have two separate, non-peered/connected VNets, you would create two separate private DNS Zones and link them with the respective VNet (each with only one VNet). You would not use public (global) DNS zones, as you don't want to resolve them outside of your private networks.
If two private DNS zones provide the same domain, they need to be in different resource groups.
Maybe the hub and spoke network architecture is interesting for you, if you need to scale for many applications.

Related

Unable to point to existing Azure Private DNS Zones at resource creation time

I’m totally confused with Azure, Private Endpoints, and private DNS zones experience.
When operating in a hub-and-spoke architecture, all the private DNS zones are pre-populated in the hub subscription.
Private DNS Zones
I have:
Owner privileges over the resource group where the private DNS zone reside
I have owner permissions over the spoke subscription, where I want to create a storage account
Now, here’s my confusion. I don’t know if it’s me, or again another example of MSFT brilliancy, but when I create a Storage Account (in the bespoke spoke subscription) I select:
Disable Public Access
I want the Storage Account to be Private Endpoint enabled, and HERE’S THE PROBLEM. Naturally, I would want to use the privatelink.blob.core.windows.net private DNS zone that is already created in the hub subscription, but there’s NO WAY to select it! If I would proceed with the option selected, it would create a NEW private DNS zone for the Storage Account blob sub resource type, in the resource group of the actual VNet …
Private DNS integration
With this, the central DNS resolution will of course not work.
However, when I navigate to an existing Storage Account, I CAN THEN point to the subscription, rsg that is containing all my private DNS zones !
Select existing private DNS zones
Why is this a big deal? I’d like to enforce Azure Policies that would deny PaaS resources with public access enabled. Since the creation of such resources would fail, application team owners would have to create private endpoints for the service to be accessible. At the same time, I don’t want them to follow the above steps, where they would create private DNS zones within their subscription and start raising tickets that they can’t connect to it afterwards. So I would put another policy in place, that would deny creation of private DNS zones prefixed with private link (and just exclude the resource group in the hub subscription, since there it is even anticipated that private DNS zones are created).
So with this in place, they would have to first create the storage account with a) public access disabled, b) Integrate with private DNZ zone set to No, and afterwards, once the resource is created, add the private endpoints that would integrate with the hub’s private DNS zones. And yes, that works, but WHY can’t the creation wizard let me do this at creation time ??
Anyone to share their experience with this, or perhaps correct my if I’m misunderstanding something ?

Can we assign a virtual network with multiple private dns zone namespaces as virtual link?

Can we assign a virtual network with multiple private DNS zone namespaces as virtual links?
I have a virtual network privateEndpoint-VNet that needs to be added as a virtual link with multiple private DNS zones each one having the same namespace privatelink.blob.core.windows.net in different resource groups and if I tried to add it while creating a private endpoint with Integrated private DNS zone option selected, I get below error
"A virtual network cannot be linked to multiple zones with overlapping namespaces.
You tried to link virtual network with 'privatelink.blob.core.windows.net' and 'privatelink.blob.core.windows.net' zones.".
if we can't assign a virtual network with multiple private DNS zones each having the same namespace as virtual links, how can we resolve the above error message?
Our requirement is as such we need resources of privateEndpoint-VNet to connect with all managed storage account services in all resource groups privately.
You cannot assign many DNS zones with the same namespace to the single VNET. The proper way of managing DNS zones it to have single DNS zone namespace and assign it (link) to multiple VNETs.
For example:
Let's say you have 2 storage accounts. Storage accounts are in different VNETs. You create a single Private DNS zone privatelink.blob.core.windows.net in your environment.
The valid solution would be to link your private DNS zone to every VNET that needs to be able to solve hostnames in that zone. Both of the storage accounts would register (or would be added manually if there is already a different zone with auto-registration enabled) against that single DNS zone and their hostname would be resolvable for all resources in linked VNETs.

How to make public link and private endpoint link of a azure redis service work simultaneously

How to make public link and private endpoint link of an azure Redis service work simultaneously.
Can we keep both functionalities work simultaneously like outside users using the original public IP link and internal users using a private endpoint link to connect to an Azure Redis instance or azure storage account?
I have this kind of scenario
Here you have to enforce somehow the DNS resolution happening within your internal network so that any internal calls fetches the record created in the Private DNS Zone alongside the Private Endpoint.
Within your Virtual Network, you can for example change the DNS servers. Be careful, it might have severe impacts, as you might also need to re-specify how to reach other resources within Azure (since Azure DNS 168.63.129.16 is gone at that point). Be also aware about the precedence if you have several DNS servers at different levels.

Azure: Multiple VMs behind same public IP?

What is the correct process for getting multiple VMs to report their public IP as the same address in Microsoft Azure? I have them in the same subnet on the same VNet already, and there is a gateway on that VNet with a dedicated public IP however all machines are reporting unique public IPs.
In general each Azure VM have their own IP (Public or Private or both).
However you can keep one IP at front and VM behind by -
Option 1 : Place a azure public loadbalancer and keep the VMs behind this and route the traffic by creating rules.
Option 2 : Easy Option if the VMs are identical (same OS, Size etc) you can use the Azure Dev test Lab with shared IP option for multiple VM. This option is there in the advance setting part of create VM dialog, here you can define the instance count as well.
Link for DevTestLab - https://learn.microsoft.com/en-us/azure/devtest-labs/tutorial-create-custom-lab

How Do I Resolve A Public DNS Name To An Internal IP On Azure?

I have an azure network set up with the default Azure DNS.
All the VMs are ubuntu.
When I try to access another VM on the network via the public DNS name it resolves to the public IP.
How do I make it resolve to the internal IP when I request it from the virtual network (and obviously still resolve to the public IP when requested externally).
I'm interested in cli answers as well as configurations through the portal.
Azure DNS for IaaS and PaaS solutions
Please see this article for more information on Azure's own DNS service associated with virtual networks. In short
When role instances and VMs hosted in Azure need to resolve domain
names to internal IP addresses, they can use one of two methods:
Azure-provided name resolution
Name resolution that uses your own DNS server (which might forward queries to the Azure-provided DNS servers)
The type of name resolution you use depends on how your VMs and role
instances need to communicate with each other.
Azure DNS Private Zones (in preview)
There's also a relatively new service called, Azure DNS Private Zones that allow you to set up a private DNS service to be used with, for example virtual networks.
This service allows you to set up a private domain and private IPs for your machines. See this page for more information and some common usage scenarios.
Also, see this this feature suggestion:
Enable split DNS for providing both public and internal name resolution to VMs in the VNET

Resources