Closed Sen closed 5 years ago
@FlowerWrong
There are two dns mode here.
Your config.
[dns]
# dns mode: fake or udp_relay_via_socks5, default fake, fake means google.com -> 10.192.10.126
dns-mode = fake
# DEFAULT VALUE: 53
# dns-port = 53
# backend dns
# DEFAULT VALUE: 114.114.114.114:53, 223.5.5.5:53
# nameserver = 114.114.114.114:53
# nameserver = 223.5.5.5:53
# dns-ttl = 600
# dns-packet-size = 4096
# dns-read-timeout = 5
# dns-write-timeout = 5
# auto-config-system-dns = false
[route]
# eg: sudo ip route add 91.108.4.0/22 dev tun0
# If you have large route tables, please add it with route batch mode by yourself,
# or it will table a long time.
#v = 198.18.0.0/15
#v = 91.108.4.0/22
#v = 91.108.56.0/22
#v = 109.239.140.0/24
#v = 149.154.160.0/20
# v = 149.154.167.0/24
#v = 8.8.8.8
#v = 4.4.4.4
#v = 10.0.0.0/24
v = 0.0.0.0/1
v = 128.0.0.0/1
DNS fake
mode worked with config rules. So you need not config route table as 0.0.0.0/1
and 128.0.0.0/1
. The route here just works for which use ip for network not domain name or dns server, eg telegram ip and google dns server.
# telegram ip
v = 198.18.0.0/15
v = 91.108.4.0/22
v = 91.108.56.0/22
v = 109.239.140.0/24
v = 149.154.160.0/20
v = 149.154.167.0/24
# google dns server
v = 8.8.8.8
If you are using udp_relay_via_socks5
, you may need to set it. See my ip2socks project shell.
@FlowerWrong thanks for reply. as i know, udp_relay_via_socks5 option will resend dns request to socks5 server, right? i implemented a socks5 server, but haven't supported UDP mode yet. Can i just setting dns in the normal way? which means relay dns request to my own local system.
udp_relay_via_socks5 option will resend dns request to socks5 server, right?
Yes, via udp.
i implemented a socks5 server, but haven't supported UDP mode yet.
You can use tcp dns, eg pdnsd. chrome(udp dns query) -> pdnsd(change to tcp dns query) -> your local socks5 -> remote socks5 -> tcp dns server(eg google).
Can i just setting dns in the normal way? which means relay dns request to my own local system.
What do you mean? Fake mode is doing this way. Starting a dns server on 127.0.0.1:53
, and change system dns server to 127.0.0.1
. And then all dns query will be take over by local dns server.
@Sen
Hmm, but fake mode dosen't work at all on my side.
i've removed route
v = 0.0.0.0/1
v = 128.0.0.0/1
i think i need to implement UDP mode of socks5. Thanks anyway.
Usually, fake mode
need not udp support for socks 5 unless you need to use it for udp flow, eg udp game. Please check you system dns has been set to 127.0.0.1
or not if there are no any dns logs in termainl.
At the beginning, you can use the default config file just change the proxy server.
not work on my side, no DNS request like yours. Don't know why. i tried config.example.ini without any change, but those websites which blocked can't be viewed.
@Sen
dig @127.0.0.1 baidu.com
, please try this command to test dns work or not.
@FlowerWrong fake mode dns not work, is that my computer's problem?
May be I know that. The shell can not get your active network service right.
My log.
2018/11/05 22:29:12 cmd.go:38: [shell] output Current active networkservice is Wi-Fi, 5750EEA5-6D39-4083-896E-1DDED3A42B1A
You can set the auto-config-system-dns flag to false, and then set your dns by hand.
mac OS, master branch, compiled with latest code. and also can't find any dns record in log
i added a command to make tun work, my local gateway is 192.168.10.1
and this is my config.ini
any idea?