`
zhangfeilo
  • 浏览: 391716 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

Ubuntu-修改计算机名和对外IP 域名(hostname)

阅读更多

ubuntu在安装的时候会让你输入一个主机名,如果安装之后觉得不好,又想改,怎么办?方法很简单所,打开“终端”,输入:gedit /etc/hostname ,然后在弹出的窗口中直接修改,修改完按保存即可。当然也可以使用vi等其他文本编辑工具。

默认:

hostname#设置主机名为hostname

输入:gedit /etc/hosts修改hosts,让 hostname 对应的IP为正确的远程可访问IP

默认

127.0.0.1    localhost
127.0.1.1    hostname
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
修改
127.0.1.1 hostname修改为正确的远程可访问IP如192.168.1.100

 

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics