无法连接到主机C:主机名未找到(11001)Windows,DNS问题? [英] Cannot connect to host in C: Hostname not found (11001) on Windows, DNS Problem?

查看:1341
本文介绍了无法连接到主机C:主机名未找到(11001)Windows,DNS问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用连接到C中的远程服务器的API,但我仍然收到以下错误消息:

I am trying to use an API that connects to a remote server in C, but I keep having the following error message:

log_message: 15:13:19.489 I [ap:1388] Connecting to AP A3.spotify.com:4070

log_message: 15:13:19.490 E [ap:1324] AP Socket Error: Hostname not found (11001)

log_message: 15:13:19.491 E [ap:3396] Connection error:  4

log_message: 15:13:19.491 I [ap:1388] Connecting to AP A1.spotify.com:80

如您所见,日期,错误消息是即时的,所以我认为某些东西在我的电脑上本地阻止了消息。

As you can see with the dates, the error message is instantaneous, so I think something is blocking the messages locally on my computer.

这是使用Wireshark捕获的TCP流:

Here is the TCP stream I captured with Wireshark:

30  1.682802    MyLocalIp   193.182.8.15    HTTP    Continuation or non-HTTP traffic
31  1.702236    193.182.8.15    MyLocalIp   HTTP    Continuation or non-HTTP traffic
33  1.901706    MyLocalIp   193.182.8.15    TCP 50222 > http [ACK] Seq=12 Ack=12 Win=251 Len=0

所以,根据Wireshark ,我的电脑发送的第一封邮件头标题不正确。

So, according to Wireshark, the first message sent by my computer has an incorrect Header checksum.

我知道主机是正确的,因为当我在Java中使用与JNA相同的C API时,具有以下结果:

I know the host is correct, because when I use the same C API in Java with JNA, I have the following result:

log_message() called:15:46:48.718 I [ap:1388] Connecting to AP A1.spotify.com:4070

log_message() called:15:46:53.769 E [ap:1324] AP Socket Error: Undefined Error 0x4E20 (20000)

log_message() called:15:46:53.770 E [ap:3396] Connection error:  117

log_message() called:15:46:53.770 I [ap:1388] Connecting to AP A2.spotify.com:80

log_message() called:15:46:53.789 I [ap:938] Connected to AP: 193.182.8.12:80

所以,这里4070端口的连接失败,这是正常的,因为它被公司的防火墙阻止,然后在端口80上成功。

So, here the connection fails on port 4070, which is normal because it is blocked by the company's firewall, and then it succeeds on port 80.

这里是Wireshark ca Java版本:

And here is the Wireshark capture for the Java version:

104 6.296125    MyLocalIp   193.182.8.15    TCP 50339 > http [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=8 SACK_PERM=1
107 6.575599    193.182.8.15    MyLocalIp   TCP http > 50339 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1460 SACK_PERM=1 WS=7
108 6.575732    MyLocalIp   193.182.8.15    TCP 50339 > http [ACK] Seq=1 Ack=1 Win=65536 Len=0
109 6.582627    MyLocalIp   193.182.8.15    HTTP    Continuation or non-HTTP traffic
110 6.614789    193.182.8.15    MyLocalIp   TCP http > 50339 [ACK] Seq=1 Ack=512 Win=6912 Len=0
112 6.714201    193.182.8.15    MyLocalIp   HTTP    Continuation or non-HTTP traffic
113 6.722057    MyLocalIp   193.182.8.15    HTTP    Continuation or non-HTTP traffic
115 6.746484    193.182.8.15    MyLocalIp   TCP http > 50339 [ACK] Seq=500 Ack=677 Win=8064 Len=0
116 6.750938    193.182.8.15    MyLocalIp   HTTP    Continuation or non-HTTP traffic
117 6.751093    MyLocalIp   193.182.8.15    HTTP    Continuation or non-HTTP traffic
118 6.985366    193.182.8.15    MyLocalIp   HTTP    [TCP Retransmission] Continuation or non-HTTP traffic
119 6.985416    MyLocalIp   193.182.8.15    TCP [TCP Dup ACK 117#1] 50339 > http [ACK] Seq=787 Ack=544 Win=65024 Len=0 SLE=500 SRE=544
121 7.013666    193.182.8.15    MyLocalIp   HTTP    Continuation or non-HTTP traffic
124 7.213661    MyLocalIp   193.182.8.15    TCP 50339 > http [ACK] Seq=787 Ack=1803 Win=65536 Len=0
132 7.703708    MyLocalIp   193.182.8.15    HTTP    [TCP Retransmission] Continuation or non-HTTP traffic
133 7.721265    193.182.8.15    MyLocalIp   HTTP    Continuation or non-HTTP traffic

我尝试在我的System32 / drivers / etc / hosts中添加IP 193.182.8.15文件为主机名A1.spotify.com,A2.spotify.com和A3.spotify.com,但它没有改变任何东西。

I tried adding the IP 193.182.8.15 in my System32/drivers/etc/hosts file for the hostname A1.spotify.com, A2.spotify.com and A3.spotify.com, but it didnt change anything.

我关闭Windows防火墙和防毒软件也没有帮助。

I shut down the Windows firewall and antivirus, it didn't help either.

我尝试在家里运行这个没有公司代理和防火墙的东西,但是它是一样的(除了Java版本的服务可以连接4070端口)

I tried running this at home without company proxy and firewall, but it was the same (except that on the Java version the service was able to connect on port 4070)

任何想法?

谢谢!

推荐答案

我终于找到了解决方案:
以管理员身份运行我的程序解决了问题

I finally found the solution: Running my program as Administrator solved the problem

这篇关于无法连接到主机C:主机名未找到(11001)Windows,DNS问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆