星空网 > 软件开发 > 操作系统

配置主机名和名称解析

1、查看当前主机名

    1.1 显示当前主机名 

         $ hostname

    1.2 显示主机名状态

         $ hostnamectl status

2、设置静态主机名

    2.1 更改主机名和主机名配置文件

         $ sudo hostnamectl set-hostname server0.example.com

    2.2 查看网络启动时提供主机名的配置文件

       $ cat /etc/hostname

   2.3 显示主机名状态

       $ hostnamectl status

3、 临时更改主机名

   3.1更改主机名

        $ sudo hostname testname

   3.2 显示当前主机名状态

        $ hostnamecatl status

        显示当前主机名

        $ hostname

  3.3 查看网络启动时提供主机名的配置文件

       $ cat /ect/hostname

  3.4 重启系统

       $ reboot

  3.5 显示当前主机名

      $ hostname

4、为服务器增加一个本地别名

    4.1 查询classroom.example.com的IP

       $ host classrom.example.com

   4.2 修改/etc/hosts使class具有IP172.25.254.254,并用于与classroom.example.com通信

       $ sudo vim /etc/hosts

       $ cat /etc/hosts

   4.3 查找class的IP

      $ host class

   4.4 ping class

      $ ping -c3 class

 




原标题:配置主机名和名称解析

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

发菲律宾什么快递:https://www.goluckyvip.com/tag/96533.html
菲律宾有哪些快递:https://www.goluckyvip.com/tag/96534.html
怎么寄菲律宾快递:https://www.goluckyvip.com/tag/96535.html
寄菲律宾 用什么快递:https://www.goluckyvip.com/tag/96536.html
什么快递寄菲律宾:https://www.goluckyvip.com/tag/96537.html
菲律宾有快递吗:https://www.goluckyvip.com/tag/96538.html
在古巴做游轮 古巴旅游项目:https://www.vstour.cn/a/363194.html
西藏旅游攻略自驾游需要多少天 去西藏旅游自驾游要多久时间:https://www.vstour.cn/a/363195.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流