title: System.Net.WebException: The remote name could not be resolved:
body: <p>I am testing an endpoint that I am experiencing some issues with.</p>
  
  <p>I am simply using <code>HttpClient</code> in a loop that performs a request each hour.</p>
  
  <pre><code>var httpClient = new HttpClient();
  var message = httpClient.GetAsync(url).Result;
  Console.WriteLine(message.StatusCode);
  </code></pre>
  
  <p>Once in a while I am getting this exception:</p>
  
  <blockquote>
    <p>System.Net.Http.HttpRequestException: An error occurred while sending
    the request. ---> System.Net.WebException: The remote name could not
    be resolved: 'xxx'</p>
  </blockquote>
  
  <p>The experience is that right after the exception, the URL can be accessed. In a browser you simply refresh the page and all is good.</p>
  
  <p>I still haven't got any reports from users experiencing it so I am wondering if it's just a local issue here but could use a little information to help diagnose.</p>
  
  <p>Is there a way to check if <em>The remote name could not be resolved</em> is caused by an DNS issue or by a web server issue from the exceptions? Can I get more information out of <code>HttpCLient</code> or do I need more advanced diagnostic tools?</p>