无法连接到本地主机或本地 IP,但可以连接到其他服务器或网站

无法连接到本地主机或本地 IP,但可以连接到其他服务器或网站

我有一台安装了 nginx|bind|mysql 的服务器,一切运行正常,但我无法连接到本地主机或服务器上托管的任何网站。

我尝试了 ping 和 wget,但它们都不起作用并且给出连接超时。

服务器已安装Centos。

有人可以帮忙吗?

netstat -anp 给出:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      522/nginx
tcp        0      0 0.0.0.0:245                 0.0.0.0:*                   LISTEN      536/sshd
tcp        0      0 <MYIP>:53               0.0.0.0:*                   LISTEN      408/named
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      408/named
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      845/sendmail
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      408/named
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      786/mysqld
tcp        0      0 <MYIP>:245              <MYIP1>:60660               ESTABLISHED 971/sshd
tcp        0      0 :::245                      :::*                        LISTEN      536/sshd
tcp        0      1 ::ffff:127.0.0.1:40591      ::ffff:127.0.0.1:25         SYN_SENT    1594/sendmail: ./s6
udp        0      0 <MYIP>:53               0.0.0.0:*                               408/named
udp        0      0 127.0.0.1:53                0.0.0.0:*                               408/named
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  11     [ ]         DGRAM                    2267686683 394/rsyslogd        /dev/log
unix  2      [ ACC ]     STREAM     LISTENING     2267685389 1/init              @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     2267692005 829/saslauthd       /var/run/saslauthd/mux
unix  2      [ ]         DGRAM                    2267685792 125/udevd           @/org/kernel/udev/udevd
unix  2      [ ACC ]     STREAM     LISTENING     2267691329 786/mysqld          /var/lib/mysql/mysql.sock
unix  2      [ ACC ]     STREAM     LISTENING     2267692892 863/php-fpm         /var/run/php5-fpm.sock
unix  2      [ ]         DGRAM                    2268728297 1594/sendmail: ./s6
unix  2      [ ]         DGRAM                    2268038395 1027/su
unix  3      [ ]         STREAM     CONNECTED     2267979481 971/sshd
unix  3      [ ]         STREAM     CONNECTED     2267979480 973/sshd
unix  2      [ ]         DGRAM                    2267979477 971/sshd
unix  2      [ ]         DGRAM                    2267692917 873/crond
unix  3      [ ]         STREAM     CONNECTED     2267692891 863/php-fpm
unix  3      [ ]         STREAM     CONNECTED     2267692890 863/php-fpm
unix  2      [ ]         DGRAM                    2267692154 853/sendmail: Queue
unix  2      [ ]         DGRAM                    2267692091 845/sendmail
unix  2      [ ]         DGRAM                    2267692004 829/saslauthd
unix  2      [ ]         DGRAM                    2267689452 543/xinetd
unix  3      [ ]         STREAM     CONNECTED     2267689322 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689321 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689320 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689319 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689318 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689317 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689316 522/nginx
unix  3      [ ]         STREAM     CONNECTED     2267689315 522/nginx
unix  2      [ ]         DGRAM                    2267687195 408/named
unix  3      [ ]         DGRAM                    2267685796 125/udevd
unix  3      [ ]         DGRAM                    2267685795 125/udevd

答案1

您是否查看过 etc/hosts 文件,并确保本地主机指向 127.0.01。还要检查并确保在网络设置中配置了 lo0。

相关内容