CentOS 修改hosts文件 vim /etc/hosts 修改完成后生效命令 /etc/init.d/network restart # 重启网络 or /etc/init.d/net.eth0 restart # 这个就是重启网卡了 Ubuntu # 重启网络命令 $sudo /etc/init.d/networking restart