Azure host name resolution inside Web App


In the last couple of days we have some problem on our Azure Web App (S3 WebSite hosted in North Europe data center) when resolving host names.

We have created a very simple .aspx page that try to resolve and sometime we receive the correct ip other times we get this error:

System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.Resolve(String hostName) at ASP._diagnostics_dns_aspx.HostName2IP(String hostname) at ASP._diagnostics_dns_aspx.Resolve(Object sender, EventArgs e)

The same problems occurs when resolving internal azure host names (* or other host names (, ...).

Our suspect is that one of the instance where the app is hosted (we currently have 2 instances) have the dns resolution broken.

You can see the full aspx page code here:

But basically it use the following code to resolve the requested host name:

  private string HostName2IP(string hostname)
      var iphost = System.Net.Dns.GetHostEntry(hostname);
      var addresses = iphost.AddressList;
      var addressList = new System.Text.StringBuilder( );
      foreach(var address in addresses)
          addressList.Append("IP Address: ");
          addressList.Append(address.ToString( ));
      return addressList.ToString( );

Any idea? It is possible that we have broken some configuration or there is a problem in Azure?

UPDATE: If I use [System.Net.Dns]::GetHostEntry("") or using nslookup inside the Kudu PowerShell console the name is always resolved. Seems to be a problem related to my website only. I have tried on both instances.

asked on Server Fault Aug 31, 2016 by Davide Icardi

1 Answer


I have an open ticket with MS that seems to confirm that it was bug on Azure side.

answered on Server Fault Sep 21, 2016 by Davide Icardi

User contributions licensed under CC BY-SA 3.0