<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sounds complicated. If it can be done effectively, I'd put it on the
wiki just for the heck of it, but would NOT recommend doing any of this
stuff as standard configuration policy (it's just not worth the time,
effort, and risks if you screw up).<br>
~ADB<br>
<br>
Jack Cummings wrote:
<blockquote cite="mid20050913144910.GH25979@ice.mudshark.org"
 type="cite">
  <pre wrap="">On Mon, Sep 12, 2005 at 11:53:04AM -0400, <a class="moz-txt-link-abbreviated" href="mailto:u-281@vif.com">u-281@vif.com</a> wrote:
 
  </pre>
  <blockquote type="cite">
    <pre wrap="">Squid can be compiled with the option --disable-internal-dns, and configured to
use an external dns server (dnsserver).  I think replacing the line
gethostbyname in dnsserver.c by something like spawnv("/usr/bin/tor-resolve",
buf, localhost:9050, NULL); could do it to use tor network for dns requests. 
Then one could grab the result from tor-resolve and send it back to dnsserver. 
I'm not that fluent in C to accomplish this, but it seems to be a viable
solution.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I made a sh wrapper around tor-resolve that outputs something that looks like
the output of dnsserver:

--
[jack@needle:jack]$ cat /opt/pkg/squid/libexec/tor-dnsserver
#!/bin/sh
while read addr
do
        r=$(tor-resolve $addr)
        echo "\$addr 0 $r"
done
--

And in the squid.conf file:

--
...
cache_dns_program /opt/pkg/squid/libexec/tor-dnsserver
#cache_dns_program /opt/pkg/squid/libexec/dnsserver
dns_children 5
...
--

as a first pass, it works, although it does not properly handle failed DNS
requests.

Cheers, 

--Jack 

--
Jack (John) Cummings                           <a class="moz-txt-link-freetext" href="http://mudshark.org/">http://mudshark.org/</a>
PGP fingerprint: 0774 D073 E386 B70B 6B16  2D2B 1DD8 F8B0 CCF0 FAEE
Now playing on Prime:    Bombtrack -- Rage Against the Machine
Now playing on Remedial: Recovering the Satellites -- Counting Crows
  </pre>
</blockquote>
<br>
</body>
</html>