title: Specifying DNS server for lookup in Go
body: <p>Is there a way to specify which DNS server to use for a name lookup?</p>
  
  <p>Looking at <a href="https://golang.org/pkg/net/#LookupHost" rel="noreferrer">https://golang.org/pkg/net/#LookupHost</a> seems it will use only the local resolver</p>
  
  <pre><code>LookupHost looks up the given host using the local resolver. It returns a slice 
  of that host's addresses.
  </code></pre>
  
  <p>Also earlier on that link</p>
  
  <pre><code> It can use a pure Go resolver that sends DNS requests directly to 
   the servers listed in /etc/resolv.conf,
  </code></pre>
  
  <p>How could one do a lookup against arbitrary servers like one can do with dig?</p>
  
  <pre><code>dig @8.8.8.8 google.com
  </code></pre>