ty

Results 299 comments of ty

I can sure that if the address is already in cache, everything works correctly. I will try to gdb it tomorrow, when the problem shows up again.

``` 2020-06-11T10:25:38.866+08:00 TRACE [shadowsocks::relay::dns_resolver::trust_dns_resolver] DNS resolving www.baidu.com:80 with trust-dns 2020-06-11T10:25:38.866+08:00 DEBUG [trust_dns_proto::xfer::dns_handle] querying: www.baidu.com A 2020-06-11T10:25:38.867+08:00 DEBUG [trust_dns_resolver::name_server::name_server_pool] sending request: [Query { name: Name { is_fqdn: false, labels: [www, baidu,...

``` 2020-06-11T22:52:25.931+08:00 DEBUG [trust_dns_resolver::name_server::name_server] name_server connection failure: request timed out 2020-06-11T22:52:25.931+08:00 DEBUG [trust_dns_proto::xfer::dns_exchange] stream errored while connecting: ProtoError { kind: Timeout, backtrack: None } 2020-06-11T22:52:25.931+08:00 DEBUG [trust_dns_proto::xfer::dns_exchange] stream errored while...

I see.. It is all about `trust_dns_resolver::system_conf::read_system_conf`. `read_system_conf` is called when server starts, but when I switch Wi-Fi, name servers are changed!! But `trust_dns_resolver` still tried to use the old...

My solution is to add a script to watch `/etc/resolv.conf` and restart my servers when DNS configuration is changed.

I found an issue https://github.com/c-ares/c-ares/issues/324 , it seems that we can call functions from `libresolv` on BSD-like systems, specifically in this case, macOS. There are [resolv](https://crates.io/crates/resolv), [resolv-sys](https://crates.io/crates/libresolv-sys) wrappers on crates.io.

A simple solution, add several member functions for `ConnectionProvider` ```rust pub trait ConnectionProvider: 'static + Clone + Send + Sync + Unpin { /// The handle to the connect for...

`CustomizeConnection` is good, but `on_acquire` will not work for `SO_MARK` and `SO_BINDTODEVICE`, which have to be called before `connect()` and after `bind()`. On the otherhand, for some use cases, a...

For TLS, HTTPS, mDNS, you may need more like `before_tls`, .... :(

How about customizing the underlying connection, for example, send queries via an `UnixDatagram` or `UnixStream`. PS: This is not a common use case, just for discussion.