简体   繁体   中英

Azure DNS zone record not resolving to specified IP from App service to Virtual Machine

I followed the documentation guide here to configure an Azure DNS zone for a virtual network.

I then created a virtual machine on that virtual network and provisioned a virtual network gateway to allow my Azure web apps to communicate with the virtual machine using VNet integration. My web apps are then able to resolve against the virtual machines private IP as expected.

I then created an 'A' type record set within the DNS zone resolving a service name against the private IP of the virtual machine just like here .

However, when I then attempt to access the DNS configured service name that should resolve against the private IP address of the virtual machine, I get the following error:

curl: (6) Could not resolve host: xxxx.local

Am I missing something obvious here?

I can not reproduce this error following your steps:

  1. Create an Azure VNet with a DNS private zone like private.test.com .
  2. Create a VM and a VPN gateway on that VNet.
  3. Enable VNet integration with my Azure web app service.

My web apps are able to resolve against the virtual machines private IP as expected. This could verify the Azure private DNS zone should work. Then I also create an A record for a custom name against the VM private IP address. Both scenarios work.

You could check if an A record is something like below picture in the private DNS zone. 在此输入图像描述 Then you could verify if curl with http:// or without that, or without the specific port 9200, the error is still the same. 在此输入图像描述

I suggest using SET WEBSITE_DNS_ command. This command will output the current DNS server that is being used by the web app. If the error Environment variable WEBSITE_DNS_ not defined is received , no custom DNS servers are configured for the web app. See more details about networking Related Commands for Azure App Services .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM