-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cannot use container's name as --server-addr
in configuration.
#773
Comments
So, what does |
|
This is the config file: {
"server": "con_kcp",
"server_port": 1090,
"local_address": "0.0.0.0",
"local_port": 1080,
"password": "mypass",
"timeout":120,
"method":"chacha20-ietf-poly1305",
"fast_open": false,
"log": {
"level": 1
}
}
|
What did you see from logs? Try to set |
Name resolution seems to take no effect:
|
You have to make a request. The remote server will only be resolved when creating new tunnels. |
Well, my log dumps as:
The ping con_kcp
PING con_kcp (172.20.0.3): 56 data bytes
64 bytes from 172.20.0.3: seq=0 ttl=64 time=0.322 ms
64 bytes from 172.20.0.3: seq=1 ttl=64 time=0.431 ms Everything works fine after changing the server address from using the domain name to IP address:
|
Yes. It didn't show the actual resolved IP in log. :(
Is the This line of
How to reproduce? Could I reproduce it locally with my laptop? |
I have narrowed the scope of this issue to the problem of whether a domain name is valid or not. For a simple POC, I use the docker compose file and configuration files of ss: ssserver config file {
"server": "0.0.0.0",
"server_port": 1090,
"password": "mypass",
"timeout": 120,
"method": "chacha20-ietf-poly1305",
"fast_open": false,
"log": {
"level": 3
}
} sslocal config file {
"server": "server.ss.invalid",
"server_port": 1090,
"local_address": "0.0.0.0",
"local_port": 1080,
"password": "mypass",
"timeout":120,
"method":"chacha20-ietf-poly1305",
"fast_open": false,
"log": {
"level": 3
}
} docker compose file: version: '3.5'
services:
server.ss.invalid:
image: ghcr.io/shadowsocks/ssserver-rust:latest
container_name: server.ss.invalid
restart: always
ports:
- 127.0.0.1:1090:1090
volumes:
- type: bind
source: /tmp/poc/server.json
target: /etc/shadowsocks-rust/config.json
read_only: true
local.ss.invalid:
image: ghcr.io/shadowsocks/sslocal-rust:latest
container_name: local.ss.invalid
restart: always
ports:
- 127.0.0.1:1080:1080
volumes:
- type: bind
source: /tmp/poc/client.json
target: /etc/shadowsocks-rust/config.json
read_only: true
I think this problem is related to the verification of domain name format which is done before the actual resolution. For container circumstances, the container name, which is a superset of valid domain names, acts as a domain name in most situations. |
It's irrelevent. This change is only for |
Insterestingly,
Run
So there was a DNS query sent to There is no packet could be captured by |
DNS server address for containers which use custom network is 127.0.0.11:53. Container Try to capture packets on lo interface to see if any clue can be found. |
Tried and captured nothing. |
:( sad... |
Sending queries directly to the But it is actually working well for other valid domains, like:
So I think the
When sending queries to
|
|
Everything works fine after changing containers' name to version: '3.5'
services:
server.ss:
image: ghcr.io/shadowsocks/ssserver-rust:latest
container_name: server.ss
restart: always
ports:
- 127.0.0.1:1090:1090
volumes:
- type: bind
source: /tmp/poc/server.json
target: /etc/shadowsocks-rust/config.json
read_only: true
local.ss:
image: ghcr.io/shadowsocks/sslocal-rust:latest
container_name: local.ss
restart: always
ports:
- 127.0.0.1:1080:1080
volumes:
- type: bind
source: /tmp/poc/client.json
target: /etc/shadowsocks-rust/config.json
read_only: true But why
Well, |
Yes, I have mentioned that earlier. That is why I used Should we opt to use some more 'naive' name resolution method before the action that is taken by |
It can be done by removing |
Maybe, providing a fallback strategy is more compatible. For domain names that are obviously not valid, or domain names that cannot be handled by |
https://github.com/shadowsocks/shadowsocks-rust/releases/tag/v1.13.4 Add a |
Seems still not working.
I have updated my client config in which "DNS" is now pointed to "system": {
"server": "server.ss.invalid",
"server_port": 1090,
"local_address": "0.0.0.0",
"local_port": 1080,
"password": "mypass",
"timeout":120,
"method":"chacha20-ietf-poly1305",
"fast_open": false,
"dns": "system",
"log": {
"level": 3
}
} NOTE: Don't test by accessing "baidu.com" in non-incognito mode. The web seems to be cached and shows the result correctly. |
This comment was marked as outdated.
This comment was marked as outdated.
Set |
打扰一下,我觉得这样做,并不太优雅。为什么不能先做hosts文件解析,没结果再扔应用定义的dns服务做处理? |
It doesn't related to host file. |
It works now. Close this issue. |
BTW, why not just make the container name to be a valid domain name? |
Well, the main reason is that we haven't encountered such a problem before by using Shifting from old container names to new ones requires some time, and we are now making the process to do that. |
I use
kcptun
andsslocal
together to speed up network access. Both of these two services run in containers (two separate containers).I can ping
kcp
server fromss
by the container name, saycon_kcp
.However, using this
con_kcp
as--server-addr
in the configure file fails the connection to kcp.It works fine to use container's address instead of
con_kcp
domain name.How could I resolve this?
The text was updated successfully, but these errors were encountered: