title: Header Check C# is always 403?
body: <p>im trying to ping a list of domains to get initial indications if they exist - if they dont exist i dont get a ping back - which throws and exception. not a problem, except for some reason redirects also dont ping back.</p>
  
  <p>so im trying to get the http header responce of the exception url. but no matter what i get a 403 response. any ideas?</p>
  
  <pre><code>private void hunt_Click(object sender, EventArgs e)
      {
          listBox1.Items.Clear();
          string hostAddress = txtKeyword.Text;
          string combined;
  
          string[] strArray = new string[] { ".com", ".net", ".org", ".ca", ".gov" };
  
          foreach (string str in strArray)
          {
  
              combined = hostAddress + str;
  
  
              string result = string.Empty;
              try
              {
                  Ping ping = new Ping();
                  int timeout = 1500;
                  PingReply pingreply = ping.Send(combined, timeout);
  
  
                  if (pingreply != null &amp;&amp; pingreply.Status.ToString() != "TimedOut")
                  {
                      result = "Address: " + pingreply.Address + "\r"
                           + "Roundtrip Time: " + pingreply.RoundtripTime + "\r"
                           + "TTL (Time To Live): " + pingreply.Options.Ttl + "\r"
                           + "Buffer Size: " + pingreply.Buffer.Length + "\r";
  
                      listBox1.Items.Add(combined + " " + result);
                  }
                  else
                  {
  
                      listBox1.Items.Add(combined + " not found");
                  }
  
              }
  
  
              catch (Exception pingError)
              {
                  HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www."+combined);
                  request.Method = "HEAD";
                  HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                  HttpStatusCode status = response.StatusCode;
                  listBox1.Items.Add(status);
              }
  
          }
      }
  </code></pre>
  
  <p>thanks in advance</p>
  
  <p>EDIT Ping error as follows:</p>
  
  <pre><code>System.Net.NetworkInformation.PingException: An exception occurred during a Ping     request. ---&gt; System.Net.Sockets.SocketException: No such host is known
     at System.Net.Dns.GetAddrInfo(String name)
     at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
     at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
     at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout,     Byte[] buffer, PingOptions options)
     --- End of inner exception stack trace ---
     at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout,     Byte[] buffer, PingOptions options)
     at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout)
     at DomainHunter.Form1.hunt_Click(Object sender, EventArgs e) in 
  </code></pre>