编辑hosts:

1
vim /etc/hosts

添加需要的信息,保存后退出,然后重启hosts:

1
/etc/init.d/network restart

可以查看是否修改成功:

1
cat /etc/hosts