Linux配置host的步骤如下:打开终端,使用root用户登录;
Linux配置host的步骤如下:
1. 打开终端,使用root用户登录;
2. 使用vi编辑器打开/etc/hosts文件,添加要配置的host信息;
3. 保存/etc/hosts文件,并退出vi编辑器;
4. 使用命令“sudo service network restart”重启网络服务,使配置生效。
以下是具体代码:
# login as root
su root
# open /etc/hosts file with vi editor
vi /etc/hosts
# add host info in the file
127.0.0.1 localhost
192.168.1.100 www.example.com
# save and exit
:wq
# restart network service
sudo service network restart
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(47条)