Make DnsPort, IPv6, and AutomapHostsOnResolve work together
From legacy/trac#10465 (moved): I started Tor with "./src/or/tor -dnsport '9999 preferipv6automap' -automaphostsonresolve 1 -automaphostssuffix . "
Then I did:
[619]$ dig @localhost -p 9999 aaaa www.torproject.org
; <<>> DiG 9.8.3-P1 <<>> @localhost -p 9999 aaaa www.torproject.org
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45384
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.torproject.org. IN AAAA
;; ANSWER SECTION:
www.torproject.org. 60 IN A 127.237.144.204
;; Query time: 0 msec
;; SERVER: 127.0.0.1#9999(127.0.0.1)
;; WHEN: Sun Dec 22 09:19:54 2013
;; MSG SIZE rcvd: 52
and
[621]$ dig @localhost -p 9999 example.com
; <<>> DiG 9.8.3-P1 <<>> @localhost -p 9999 example.com
; (3 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18398
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 60 IN A 127.201.101.133
;; Query time: 0 msec
;; SERVER: 127.0.0.1#9999(127.0.0.1)
;; WHEN: Sun Dec 22 09:20:31 2013
;; MSG SIZE rcvd: 45
It seems to be sending A even if it was asked for an AAAA.
(There are deeper DNSPort+IPv6 issues going on, of course, but this part is probably easier, and it's an independently useful bit of functionality.)
See legacy/trac#10465 (moved) notes for more