title: The remote name could not be resolved "www.google.com"
body: <p>I am in a company network. In this network <strong>i can't ping external</strong> websites by IP. I can only call them by url like the browser does. Thats why i use <strong>WebRequest</strong>.</p>
  
  <p>When i try to call "www.google.com" i got a "remote name could not be resolved (www.google.com)".</p>
  
  <p>I have no "blocked" entry in my firewall. With this code i can call internal websites but not external.</p>
  
  <p>This is my Code:</p>
  
  <pre><code>public void pingIP()
      {
          try
          {
  
              var url = uriBuilder;
              HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url.Uri);
              //request.Accept = "*/*";
              //request.UseDefaultCredentials = true;
              //request.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
              //request.UserAgent = "Foo";
              //request.Accept = "*/*";
              request.Method = "HEAD";
              HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  
              _PingByURL = response.StatusCode == HttpStatusCode.OK;
          }
          catch
          {
  
          }
  
      }
  </code></pre>
  
  <p>In app.config:</p>
  
  <pre><code>  &lt;system.net&gt;
        &lt;defaultProxy enabled ="true" useDefaultCredentials = "true"&gt;
           &lt;proxy usesystemdefault ="True" bypassonlocal="True"/&gt;
        &lt;/defaultProxy&gt;
    &lt;/system.net&gt;
  </code></pre>
  
  <p>How can i resolve the remote name? And is this the fast and cleanest way to check if a website is reachable by URL?</p>
  
  <p>Thank you!</p>