There's a number of moving parts here so I'll try and bullet-point the setup (PS: all of the domain names and IP addresses below are fictitious).
- I have an Azure AD Domain Service for "mydomain.com".
- In the properties page for that domain service, the IP addresses are 188.8.131.52 and 184.108.40.206
- This is inside a Classic VNET (ClassicVNET) - Address space 220.127.116.11/24
- In AzureRM, I have a VNET (VNET1)
- On that VNET, the DNS Servers are set to my Azure Domain Service from above (18.104.22.168 and 22.214.171.124). I'm not using the "Default - Azure Provided" DNS option.
- This ARM VNET (VNET1) is peered with the the classic VNET above (ClassicVNET).
Virtual Machines (SQL)
- I have 3 VM's running SQL Server. All three VM's are in the VNET1 network so their DNS servers are 126.96.36.199 and 188.8.131.52.
- All 3 VM's are joined to the AD domain (mydomain.com).
- I used the Windows Administration "DNS tool" to create some "A" records for mydomain.com (x.y.mydomain.com and a.b.mydomain.com).
- If I do an
nslookupon any of the VM machines for these "A" records, they resolve properly.
- Since the DNS query to my "mydomain.com" domain works in the VM, I'm assuming my network connections between the two VNETs (the ARM one and the classic one) are correct.
Azure App Service
- I also have an app service (AppService1).
- In the Networking property for this app service, I've set up a VNET connection to my ARM VNET (VNET1).
- If I click on the "click here to configure" for VNET integration, I can see the DNS servers are picked up from the VNET (184.108.40.206 and 220.127.116.11)
- I have a connection string for the app service referencing "x.y.mydomain.com" but I get timeouts trying to use it.
- If I go to the Kudu console, jump to a powershell prompt and enter
nameresolver x.y.mydomain.comI get a DNS timeout.
I can't figure out why the app service (with it's VNET integration) can't access the DNS servers but the VM's can (and the VM's and app service are both accessing the same VNET). And, yes, if I use the IP address the "A" record points to, everything works fine (so I know the app service has proper connectivity to the ARM VNET and the SQL Servers on that network).