Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support connecting to TOR SOCKS5 address in Unix Socket format #10

Closed
phantomcraft opened this issue Sep 9, 2019 · 2 comments
Closed

Comments

@phantomcraft
Copy link

Tor has an option to listen its SOCKS5 server as an unix socket.

If Tor-DNS could connect to this kind of address would be useful for containers and sandboxes.

There is a small program called "unix-to-tcp": https://github.com/porty/unix-to-tcp/blob/master/main.go

/\ Could serve as a basis.

@bfix
Copy link
Owner

bfix commented Sep 9, 2019

A new version that can connect to the Tor proxy via a Unix domain socket is pushed. Please read the changed README and report back any issues as I am not having a test environment at the moment - thanks.

@phantomcraft
Copy link
Author

I just tested here, works well:

./Tor-DNS -p "127.0.0.1:10053" -s "unix+/var/run/tor/socks"
dig @127.0.0.1 -p 10053 duckduckgo.com

; <<>> DiG 9.11.5-P4-5.1+b1-Debian <<>> @127.0.0.1 -p 10053 duckduckgo.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36522
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;duckduckgo.com.			IN	A

;; ANSWER SECTION:
duckduckgo.com.		900	IN	A	176.34.155.23

;; Query time: 1681 msec
;; SERVER: 127.0.0.1#10053(127.0.0.1)
;; WHEN: Mon Sep 09 09:24:28 EDT 2019
;; MSG SIZE  rcvd: 48

I use this config in my torrc:
SocksPort unix:/var/run/tor/socks IPv6Traffic PreferIPv6 WorldWritable

Very useful when using Tor with an isolated network namespace, even more for tunneling OpenVPN over Tor inside it, Tor-DNS provides a DNS resolutor and https://github.com/porty/unix-to-tcp provides a socks proxy, none of these having to listen on veth pairs and depending on dozen of iptables rules for preventing traffic leaking.

You can close this issue, thank you very much.

@bfix bfix closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants