

This support allows clients to query for certain resource types, like IPv4 or IPv6 addresses. Tor, in addition to that, has some sort of "remote DNS resolve" protocol built in. Once that's established it will tell your client that the connection is open, and for informational purposes will also tell your client what address that hostname resolved to.

The exit node will then do a DNS resolve and open a TCP connection to the target. When you open a connection through the tor network you usually ask your client (on its socks ports) to connect you to a hostname and port, say Your tor client, once it has created a circuit, will send that hostname and port to the exit node in its RELAY_BEGIN cell. Tor clients do not, in general, directly do DNS requests.
