![telnet:无法连接到远程主机:连接超时](https://linux22.com/image/713293/telnet%EF%BC%9A%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E8%BF%9C%E7%A8%8B%E4%B8%BB%E6%9C%BA%EF%BC%9A%E8%BF%9E%E6%8E%A5%E8%B6%85%E6%97%B6.png)
设置 postfix 服务器,试图找出它无法正常工作的原因。这是我在故障排除时运行的一个命令。我本以为可以连接,但却无法连接。
lol@foldingmachine:~$ telnet a.mx.mail.yahoo.com 25
Trying 67.195.168.31...
telnet: Unable to connect to remote host: Connection timed out
以下是一些跟踪路由的输出:
lol@foldingmachine:~$ sudo traceroute -n -T -p 25 a.mx.mail.yahoo.com
traceroute to a.mx.mail.yahoo.com (67.195.168.31), 30 hops max, 60 byte packets
1 192.168.1.1 1.040 ms 1.373 ms 1.719 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
我需要阅读 Traceroute 文档,我不确定如何解释这一点。现在要睡觉了,只是希望明天有人能看看并提出建议 :)
编辑:
按照答案所述运行 ncat(在我的系统上显然是“netcat”)。这是我的 dig 输出:
dig yahoo.com mx
...
;; ANSWER SECTION:
yahoo.com. 171 IN MX 1 mta5.am0.yahoodns.net.
yahoo.com. 171 IN MX 1 mta7.am0.yahoodns.net.
yahoo.com. 171 IN MX 1 mta6.am0.yahoodns.net.
...
和 netcat:
netcat -v mta6.am0.yahoodns.net. 25
netcat: connect to mta6.am0.yahoodns.net. port 25 (tcp) failed: Connection timed out
netcat: connect to mta6.am0.yahoodns.net. port 25 (tcp) failed: Connection timed out
netcat: connect to mta6.am0.yahoodns.net. port 25 (tcp) failed: Connection timed out
netcat: connect to mta6.am0.yahoodns.net. port 25 (tcp) failed: Connection timed out
netcat: connect to mta6.am0.yahoodns.net. port 25 (tcp) failed: Connection timed out
... (it keeps trying)
因此,即使a.mx.mail.yahoo.com
实际上不存在,我也无法访问真正的服务器。
答案1
是的,我得到了和你相同的结果。
ncat -v a.mx.mail.yahoo.com 25
Ncat: Version 6.47 ( http://nmap.org/ncat )
Ncat: Connection timed out.
但这并不困扰我:
dig yahoo.com mx
...
;; ANSWER SECTION:
yahoo.com. 1428 IN MX 1 mta6.am0.yahoodns.net.
...
ncat -v mta6.am0.yahoodns.net. 25
Ncat: Version 6.47 ( http://nmap.org/ncat )
Ncat: Connected to 74.6.137.64:25.
220 **************************************
答对了。