简体   繁体   English

Azure DNS区域记录未解析到从App服务到虚拟机的指定IP

[英]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. 我按照此处的文档指南为虚拟网络配置Azure DNS区域。

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. 然后,我在该虚拟网络上创建了一个虚拟机,并配置了一个虚拟网络网关,以允许我的Azure Web应用程序使用VNet集成与虚拟机进行通信。 My web apps are then able to resolve against the virtual machines private IP as expected. 然后,我的Web应用程序可以按预期解析虚拟机专用IP。

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 . 然后,我在DNS区域中创建了一个“A”类型的记录集,解析了虚拟机私有IP的服务名称,就像这里一样。

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: 但是,当我尝试访问应根据虚拟机的专用IP地址解析的DNS配置的服务名称时,我收到以下错误:

curl: (6) Could not resolve host: xxxx.local curl:(6)无法解析主机: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 . 使用像private.test.com这样的DNS专用区域创建Azure VNet。
  2. Create a VM and a VPN gateway on that VNet. 在该VNet上创建VM和VPN网关。
  3. Enable VNet integration with my Azure web app service. 启用VNet与我的Azure Web应用程序服务集成。

My web apps are able to resolve against the virtual machines private IP as expected. 我的Web应用程序能够按预期解析虚拟机专用IP。 This could verify the Azure private DNS zone should work. 这可以验证Azure私有DNS区域应该工作。 Then I also create an A record for a custom name against the VM private IP address. 然后,我还针对VM专用IP地址创建自定义名称的A记录。 Both scenarios work. 两种情况都有效。

You could check if an A record is something like below picture in the private DNS zone. 您可以检查A记录是否类似于私有DNS区域中的下图。 在此输入图像描述 Then you could verify if curl with http:// or without that, or without the specific port 9200, the error is still the same. 然后你可以验证是否curlhttp://或没有,或没有特定端口9200,错误仍然是相同的。 在此输入图像描述

I suggest using SET WEBSITE_DNS_ command. 我建议使用SET WEBSITE_DNS_命令。 This command will output the current DNS server that is being used by the web app. 此命令将输出Web应用程序正在使用的当前DNS服务器。 If the error Environment variable WEBSITE_DNS_ not defined is received , no custom DNS servers are configured for the web app. 如果Environment variable WEBSITE_DNS_ not defined is received的错误Environment variable WEBSITE_DNS_ not defined is received ,则不会为Web应用程序配置自定义DNS服务器。 See more details about networking Related Commands for Azure App Services . 查看有关Azure App Services的网络相关命令的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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