title: Tell urllib2 to use custom DNS
body: <p>I'd like to tell <code>urllib2.urlopen</code> (or a <strong>custom opener</strong>) to use <code>127.0.0.1</code> (or <code>::1</code>) to resolve addresses. I wouldn't change my <code>/etc/resolv.conf</code>, however.</p>
  
  <p>One possible solution is to use a tool like <code>dnspython</code> to query addresses and <code>httplib</code> to build a custom url opener. I'd prefer telling <code>urlopen</code> to use a custom nameserver though. Any suggestions?</p>