title: Lookup [HOST]: no such host error in Go
body: <p>I have this test program which will fetch url parallel, but when I increase the parallel number to about 1040, I start to get <code>lookup www.httpbin.org: no such host</code> error.</p>
  
  <p>After some Google, I found others say that not close the response will cause the problem, but I do close that with <code>res.Body.Close()</code>. </p>
  
  <p>What's the problem here? thanks very much.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "net/http"
      "io/ioutil"
  )
  
  func get(url string) ([]byte, error) {
  
      client := &amp;http.Client{}
      req, _ := http.NewRequest("GET", url, nil)
  
      res, err := client.Do(req)
  
      if err != nil {
          fmt.Println(err)
          return nil, err
      } 
  
      bytes, read_err := ioutil.ReadAll(res.Body)
      res.Body.Close()
  
      fmt.Println(bytes)
  
      return bytes, read_err
  }
  
  func main() {
      for i := 0; i &lt; 1040; i++ {
          go get(fmt.Sprintf("http://www.httpbin.org/get?a=%d", i))
      }
  }
  </code></pre>