0

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?

Andy McWilliams
  • 103
  • 2
  • 9

1 Answers1

0

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. enter image description here Then you could verify if curl with http:// or without that, or without the specific port 9200, the error is still the same. enter image description here

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.

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Are there any limitations in regards to the Azure DNS private zone between a Linux VM and a Windows VM? – Andy McWilliams Mar 26 '19 at 13:52
  • 1
    I think you could try to use a private domain like `.com` instead of `.local`, see the note `As a best practice, do not use a .local domain for your private DNS zone. Not all operating systems support this.` in this [doc](https://learn.microsoft.com/en-us/azure/dns/private-dns-overview). – Nancy Mar 27 '19 at 07:00
  • Still no success from my end. When I ran the `SET WEBSITE_DNS_` command via KUDU on the web app I got: 'Environment variable WEBSITE_DNS_ not defined' which seems to confirm I have misconfigured something... On the Azure Portal UI it also mentions that 'No DNS servers defined.' when I look into the web apps VNet Integration. – Andy McWilliams Apr 03 '19 at 10:09
  • You have changed to use a private domain like .com instead of .local? – Nancy Apr 03 '19 at 10:10
  • Going to set up everything again using a `.com` domain instead of `.local` as you mentioned to see if that resolves the problem. – Andy McWilliams Apr 03 '19 at 10:11
  • I think the Azure DNS record is different from DNS server. I also got that output, If you want to use DNS server, you could set up a DNS server on the VM, then set the DNS server in the Azure VNet. Refer to https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances#name-resolution-that-uses-your-own-dns-server – Nancy Apr 03 '19 at 10:15
  • Gave up on the Azure DNS private zone... Instead I just configured a DNS server using an Azure 'Ubuntu Server 18.04 LTS' virtual machine. Guide here - https://www.itzgeek.com/how-tos/linux/ubuntu-how-tos/how-to-configure-dns-server-on-ubuntu-18-04.html – Andy McWilliams Apr 11 '19 at 14:34
  • Then have you reconfigured VNet integration? and sync network again then does this could resolve the private IP address of the virtual machine from the web app? And what's your expectation? – Nancy Apr 12 '19 at 01:30
  • Does anyone know if I can verify non-public Dns like .local or .test so I can set it as custom domain for the app service ? – Ahmed Sep 15 '21 at 04:19