Linux系统怎样修改hosts

2015年1月3日10:34:39系统教程评论516

为了便于网站的调试,我们经常修改windows系统下的hosts文件,Linux系统是不是也可以修改呢,答案是肯定的,你只需要简单的编辑 /etc/hosts文件即可。文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

例如我们要添加www.osjie.com 对应的IP地址是 127.0.0.1,通过下面两种方式均可实现:文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

方法一:在ssh管理面板输入以下指令文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

echo 127.0.0.1 www.osjie.com >> /etc/hosts文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

方法二:直接编辑 vi /etc/hosts 文件,在文件最下方添加以下语句文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

127.0.0.1 www.osjie.com文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

保存后,即可实现www.osjie.com的IP解析到127.0.0.1.文章源自堕落的鱼-https://www.duoluodeyu.com/982.html

匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定