{"action":"created","issue":{"url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/905","repository_url":"https://api.github.com/repos/bluejekyll/trust-dns","labels_url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/905/labels{/name}","comments_url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/905/comments","events_url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/905/events","html_url":"https://github.com/bluejekyll/trust-dns/issues/905","id":513407181,"node_id":"MDU6SXNzdWU1MTM0MDcxODE=","number":905,"title":"\"proto error\" was returned from lookup_ip","user":{"login":"zonyitoo","id":1067951,"node_id":"MDQ6VXNlcjEwNjc5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1067951?v=4","gravatar_id":"","url":"https://api.github.com/users/zonyitoo","html_url":"https://github.com/zonyitoo","followers_url":"https://api.github.com/users/zonyitoo/followers","following_url":"https://api.github.com/users/zonyitoo/following{/other_user}","gists_url":"https://api.github.com/users/zonyitoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zonyitoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonyitoo/subscriptions","organizations_url":"https://api.github.com/users/zonyitoo/orgs","repos_url":"https://api.github.com/users/zonyitoo/repos","events_url":"https://api.github.com/users/zonyitoo/events{/privacy}","received_events_url":"https://api.github.com/users/zonyitoo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2019-10-28T16:14:26Z","updated_at":"2019-11-26T17:49:27Z","closed_at":null,"author_association":"NONE","body":"**Describe the bug**\r\n\r\nI was using `AsyncResolver` with `read_system_conf()`. I have got \"proto error\" when resolving any addresses. Some useful logs are here:\r\n\r\n```\r\n[2019-10-29][00:05:09.424859000][TRACE] [trust_dns_resolver::async_resolver::background] AsyncResolver performing lookup_ip\r\n[2019-10-29][00:05:09.425002000][DEBUG] [trust_dns_proto::xfer::dns_handle] querying: www.example.com A\r\n[2019-10-29][00:05:09.425114000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.425175000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.425222000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.425247000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.425309000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.425341000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.425362000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.425407000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.434640000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.434720000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.434798000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.434843000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.434951000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.434986000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.435031000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.435149000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.435292000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.435547000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.435617000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.435659000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.435716000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.435769000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.435791000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.435845000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.435942000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.436003000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.436065000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.436107000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.436214000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.436287000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.436329000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.436446000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.436542000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.436599000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.436645000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.436688000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.436740000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.436771000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.436793000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.436887000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.436993000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.437047000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.437115000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.437155000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.437267000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.437325000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.437362000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.437464000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.437641000][DEBUG] [trust_dns_proto::xfer::dns_handle] querying: www.example.com AAAA\r\n[2019-10-29][00:05:09.437796000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.437854000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.437922000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.437952000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.438054000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.438106000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.438137000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.438194000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.438305000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.438365000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.438426000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.438479000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.438566000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.438608000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.438631000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.438690000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.438868000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.438930000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.439010000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439040000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439102000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.439136000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439160000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439207000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.439297000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.439350000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.439394000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439418000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439479000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.439512000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439534000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439585000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.439683000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.439740000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Udp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.439784000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439807000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439859000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.439889000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.439910000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Udp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.439954000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.440032000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.151:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.440082000][DEBUG] [trust_dns_resolver::name_server::name_server] reconnecting: NameServerConfig { socket_addr: V4(211.148.192.141:53), protocol: Tcp, tls_dns_name: None, tls_config: None }\r\n[2019-10-29][00:05:09.440128000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.440150000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.151:53), timeout: 5s }\r\n[2019-10-29][00:05:09.440206000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.440237000][TRACE] [trust_dns_resolver::name_server::connection_provider] polling response inner\r\n[2019-10-29][00:05:09.440258000][DEBUG] [trust_dns_resolver::name_server::connection_provider] connecting: Tcp { socket_addr: V4(211.148.192.141:53), timeout: 5s }\r\n[2019-10-29][00:05:09.440308000][DEBUG] [trust_dns_resolver::name_server::name_server] name_server connection failure: tokio spawn error\r\n[2019-10-29][00:05:09.440377000][ERROR] [shadowsocks::relay::dns_resolver] Failed to resolve www.example.com:80, err: proto error\r\n```\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\n1. Create a `AsyncResolver` with `read_system_conf`\r\n\r\n    ```rust\r\n    let (config, opts) = read_system_conf().expect(\"Failed to read global dns sysconf\");\r\n    let (resolver, bg) = AsyncResolver::new(config, opts);\r\n\r\n    tokio::spawn(bg);  // Runs background task.\r\n    ```\r\n\r\n2.  Call `lookup_ip` with any addresses\r\n\r\n    ```rust\r\n    let addrs = resolver.lookup_ip(\"www.example.com\").await?;\r\n    ```\r\n\r\n**Expected behavior**\r\n\r\n`lookup_ip`  should return valid IPs instead of errors.\r\n\r\n**System:**\r\n - OS: macOS 10.14.6\r\n - Architecture: x86_64\r\n - Version: ?\r\n - rustc version: 1.39.0-beta.7 (23f8f652b 2019-10-26)\r\n\r\n**Version:**\r\nCrate: resolver\r\nVersion: master on github\r\n"},"comment":{"url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/comments/558744446","html_url":"https://github.com/bluejekyll/trust-dns/issues/905#issuecomment-558744446","issue_url":"https://api.github.com/repos/bluejekyll/trust-dns/issues/905","id":558744446,"node_id":"MDEyOklzc3VlQ29tbWVudDU1ODc0NDQ0Ng==","user":{"login":"zonyitoo","id":1067951,"node_id":"MDQ6VXNlcjEwNjc5NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1067951?v=4","gravatar_id":"","url":"https://api.github.com/users/zonyitoo","html_url":"https://github.com/zonyitoo","followers_url":"https://api.github.com/users/zonyitoo/followers","following_url":"https://api.github.com/users/zonyitoo/following{/other_user}","gists_url":"https://api.github.com/users/zonyitoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zonyitoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonyitoo/subscriptions","organizations_url":"https://api.github.com/users/zonyitoo/orgs","repos_url":"https://api.github.com/users/zonyitoo/repos","events_url":"https://api.github.com/users/zonyitoo/events{/privacy}","received_events_url":"https://api.github.com/users/zonyitoo/received_events","type":"User","site_admin":false},"created_at":"2019-11-26T17:49:27Z","updated_at":"2019-11-26T17:49:27Z","author_association":"NONE","body":"Remind: tokio v0.2.0 is released."}}
{"actor":{"display_login":"zonyitoo"}}