前段时间因为某些特殊原因
搬瓦工服务器在国内不能访问了(测试是否被X可以用ping.pe),还好搬瓦工提供了换ip的服务,替换ip后访问是没有任何问题了,但是不能访问任何其他网页的服务,比如用脚本安装lnmp都提示找不到服务器。我自己在服务器上测试 ping所有的服务返回都是ping: unknown host
[root@localhost ~]# ping google.com
ping: unknown host google.com
[root@localhost ~]# ping github.com
ping: unknown host github.com
[root@localhost ~]# ping baidu.com
ping: unknown host baidu.com
一般这种情况都是DNS解析问题,但是不可能这些知名企业解析会出问题,所以联系搬瓦工客服咨询这个问题,以下是他们给的解决方案,成功解决了我的问题:
Hello,
The most common reason for broken network is an old NAT iptables rule. Whenever your VPS IP changes due to migration performed via KiwiVM, you need to either modify the old rules or delete them.
You can find more information about this by visiting the following article: https://bandwagonhost.com/knowledgebase.php?action=displayarticle&id=24
Thank you.
解决方案就是在shell执行一句话重置iptables:
iptables -F; iptables -t nat -F; iptables-save > /etc/sysconfig/iptables
不需要重启任何东西就可以马上生效~
附: 替换IP方案
If you need to replace a banned IP with a clean IP, there are two options available to you:
* Option 1 * Free IP replacement. We allow you to replace a blacklisted IP with a clean IP for free, once every 10 weeks. To access this feature, first login to KiwiVM as usual, then access the following hidden page (copy+paste link into the browser's address bar):
https://kiwivm.64clouds.com/main-exec.php?mode=blacklistcheck
* Option 2 * Manual IP replacement (fees apply) available at the following link:
https://bandwagonhost.com/ipchange.php
mirror:
This is an automatic reply. If your request is not properly addressed, please reply in this ticket and one of our engineers will take a look.
注意:搬瓦工每10个星期(2.5个月)可以免费更换一次ip。