shadowsocks / shadowsocks-android

A shadowsocks client for Android
Other
35.23k stars 11.57k forks source link

5.3.0-preview doen't resolve server dns name to IP address correctly - no connection possible #2915

Closed spi43984 closed 2 years ago

spi43984 commented 2 years ago

Describe the bug With 5.2.6 connection to server is set up - either by IP address or dns name for server. With 5.3.0-preview only IP address for server can be configured - if dns name is used there is no connection established. No incoming packets on the server are to see.

To Reproduce Steps to reproduce the behavior:

  1. configure server's dns name instead of IP address.
  2. tap to establish connection
  3. check for established connection in app or trace on the server for incoming packets.

Expected behavior Connection should be established even if server's dns name is used.

Smartphone (please complete the following information):

dev4u commented 2 years ago

四个方面问题: 1 连接服务器的地址是域名?IPv4?还是IPv6?如是域名是否双栈?如果IPv6,确认手机分配的IPv6地址没丢失? 2 设定的远程dns域名,是否支持公网直连?域名的地址是否双栈? 3 使用了哪种代理模式?是否开启IPv6开关?ACL列表自建还是内置? 4 何种加密方式?如果用2022加密,用回以前的加密方式能正常?

spi43984 commented 2 years ago

四个方面问题: 1 连接服务器的地址是域名?IPv4?还是IPv6?如是域名是否双栈?如果IPv6,确认手机分配的IPv6地址没丢失? 2 设定的远程dns域名,是否支持公网直连?域名的地址是否双栈? 3 使用了哪种代理模式?是否开启IPv6开关?ACL列表自建还是内置? 4 何种加密方式?如果用2022加密,用回以前的加密方式能正常?

Sorry, had it translated by Google. Hopefully I get the questions right.

Four questions:

  1. Is the address of the connection server a domain name? IPv4? Or IPv6? If so, is the domain name dual stack? If IPv6, confirm that the IPv6 address assigned by the mobile phone is not lost?

A: IPv4 DNS name, no IPv6.

  1. Does the set remote dns domain name support direct connection to the public network? Is the address of the domain name dual stack?

A: Yes, the server ist directly connected to the Internet and works (as long IPv4 address or client 5.2.6 is used on Android) Pv4 DNS name. Server itself is dual-stack, but DNS name resolves to IPv4 address only.

  1. Which proxy mode is used? Is the IPv6 switch turned on? Is the ACL list self-built or built-in?

A: All default values, changing to something different doesn't change anything. As soon 5.3.0-preview is used there are no packets coming into the server. If IPv4 address is configured in client the connection works. If 5.2.6 is installed the connection works with DNS name as well.

  1. What kind of encryption? If 2022 is used for encryption, can it be normal to use the previous encryption method?

A: No difference what encryption is configured as client doesn't even try to connect to server - there are no incoming packets from the client traceable on the server.

iamsad3508 commented 2 years ago

actually i am having the same problem, Pixel 5

madeye commented 2 years ago

It seems a regression in shadowsocks-rust. Any changes to server hostname resolving? @zonyitoo

madeye commented 2 years ago

@zonyitoo do we still support unix://file_path in the dns field in the config file?

madeye commented 2 years ago

Try this APK: https://www.dropbox.com/s/2rgfsk8cmc3lyxg/mobile-universal-release.apk

iamsad3508 commented 2 years ago

Try this APK: https://www.dropbox.com/s/2rgfsk8cmc3lyxg/mobile-universal-release.apk

It works.

zonyitoo commented 2 years ago

@zonyitoo do we still support unix://file_path in the dns field in the config file?

How did you resolve this issue? What did I changed?

madeye commented 2 years ago

I'm using system resolver now.

Since this option means using getaddrinfo() for server's host name resolving, it can work with our android app's internal resolver.

Mygod commented 2 years ago

Would this break DDNS in VPN mode?

madeye commented 2 years ago

Would this break DDNS in VPN mode?

Nope. I checked the connect_with_hostname logic in shadowsocks-rust, it should work.

dev4u commented 2 years ago

@zonyitoo do we still support unix://file_path in the dns field in the config file?

我确认在更新android代码之前,unix://file_path是支持、正常的,更新后就不支持了。 会不会是文件权限导致uds出异常?我观察到我在rust写的一段代码也出现异常:能创建文件,但不能往里面写数据,文件大小始终为零。

kennethlau commented 2 years ago

if using private dns , can't be made the vpn connection with v2ray-plugin but there is no problem in proxy mode.