Connect to AzureVM that is accessible only from VNET using Public DNS

Alexander Shushanidze 41 Reputation points
2020-11-19T07:21:01.957+00:00

Hi. I want to have a setup with multiple peered VNets and VPN Gateway for clients to join these networks. Right now we have a VM protected with a firewall by IP, but I want to have access only from VNet. When I do that I lose the ability to use the Public DNS name that is provided by Azure. Is there a way that allows me to use Public URL but allows connections from peered VNets? For example, I can access AzureMSSQL Server from VNet because of "Allow Azure services and resources to access this server
" setting. Can I do that to VMs?
41072-image.png

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
593 questions
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
566 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,141 questions
{count} votes

Accepted answer
  1. SaiKishor-MSFT 17,186 Reputation points
    2020-11-26T06:14:19.713+00:00

    @Alexander Shushanidze

    Yes you ideally need to access these VMs using their Private DNS names if using VNET peering or VNET GW to reach the resources. If you wish to use Azure provided Azure DNS names, you can configure private DNS Zone and integrate your VNET to it, here are more details. You can also implement a custom DNS, here are details for the same. Here are some details regarding vnet peering and how it works.

    However, after some investigation, I figured that you can also use public DNS names if needed. You can achieve this using the hosts.txt file on Windows, or by adding a record to your local DNS server (if the computers use a local DNS, not a public one).

    Please let me know if you have any further questions and we will be glad to answer them for you. Thank you!

    0 comments No comments

0 additional answers

Sort by: Most helpful