An Azure machine learning service for building and deploying models.
Hello @Noopur Shah
Thank you for reaching out to Microsoft Q&A.
Based on your description, the Python script running on Azure Machine Learning is unable to resolve the hostname of your internal company server. This typically indicates a DNS configuration or network connectivity issue between the Azure ML compute environment and your corporate DNS infrastructure.
Below are the recommended checks and troubleshooting steps.
1. Verify connectivity between Azure and your internal network
Confirm how the internal server is connected to Azure. If the server resides on-premises or in another private network, ensure that connectivity exists through one of the following:
- Site-to-Site VPN
- ExpressRoute
- VNet peering (if hosted in another Azure VNet)
Without proper network connectivity, Azure ML compute instances will not be able to reach either the internal server or the DNS servers responsible for resolving its hostname.
2. Validate the DNS configuration of the Azure VNet
Check which DNS servers are configured on the VNet hosting the Azure ML compute.
Navigate to Azure Portal → Virtual Network → DNS Servers
- If your organization uses custom DNS servers (for example, Active Directory DNS servers hosted on-premises), verify that the VNet is configured to use them.
- If the VNet uses Azure-provided DNS (
168.63.129.16), internal company hostnames generally cannot be resolved unless conditional forwarding has been configured.
3. Ensure the Azure ML compute can reach the DNS servers
If custom DNS servers are being used:
- Verify that the Azure ML subnet can communicate with those DNS servers.
- Confirm that NSGs, firewalls, and UDRs do not block DNS traffic.
DNS requires:
- UDP port 53
- TCP port 53
A common cause of this issue is that the compute instance cannot route traffic to the configured DNS servers.
4. Verify DNS forwarding behavior
If your DNS servers are hosted on-premises or in a hub VNet, ensure they are forwarding requests appropriately.
Microsoft recommends that custom DNS servers forward Azure-specific queries to the Azure recursive resolver:
168.63.129.16
Improper forwarding configurations can result in hostname resolution failures.
5. Test DNS resolution from the Azure ML compute instance
Connect to the Azure ML compute instance and run:
nslookup <internal-server-name>
or
dig <internal-server-name>
Verify:
- Whether the hostname resolves successfully.
- Which DNS server responds.
- Whether the returned IP address is expected.
You may also review:
cat /etc/resolv.conf
to confirm which nameservers are configured.
6. Verify VNet peering and routing
If your DNS servers are located in another VNet:
Ensure that:
- VNet peering status is Connected
- "Allow virtual network access" is enabled
- Appropriate gateway transit and forwarding settings are configured
- Routes permit traffic between the Azure ML subnet and the DNS servers
Missing or misconfigured peering is another common cause of DNS failures.
7. Review outbound access restrictions
If outbound traffic from Azure ML is restricted using NSGs, Azure Firewall, or FQDN allowlists:
- Confirm that DNS traffic is permitted.
- Verify that required outbound destinations are not blocked.
Restrictive outbound rules can prevent both DNS resolution and access to dependent services.
8. If Private Endpoints are involved, validate Private DNS integration
If your internal services or Azure ML workspace use Private Endpoints:
Verify that:
- The appropriate Private DNS Zones exist.
- Private DNS Zone Groups are associated with the Private Endpoint.
- The Private DNS Zones are linked to the VNet hosting the Azure ML compute.
- DNS resolution returns the expected private IP address.
If DNS Zone Groups are missing or incorrectly configured, recreate the Private Endpoint with Private DNS integration enabled.
9. Isolate whether this is purely a DNS issue
As a quick validation, try connecting directly using the server's IP address instead of its hostname.
- If the IP address works but the hostname fails, the issue is isolated to DNS resolution.
- If both fail, the issue is more likely related to network connectivity or firewall restrictions.
Please refer this
https://learn.microsoft.com/azure/machine-learning/how-to-secure-workspace-vnet (Configure network traffic / Secure Azure ML with VNet)
https://learn.microsoft.com/azure/machine-learning/how-to-troubleshoot-secure-connection-workspace?view=azureml-api-2&wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#dns-configuration (Troubleshoot private endpoint connection problems—DNS configuration + nslookup validation)
https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-peering?tabs=peering-portal#create-a-virtual-network-peering (VNet peering creation/requirements referenced by the DNS failure doc)
I Hope this helps. Do let me know if you have any further queries.
If this answers your query, please do click Accept Answer and Yes for was this answer helpful.
Thank you!