Hostname 확인 방법 (3가지)

linux-k6k1:~ # hostname

linux-k6k1

linux-k6k1:~ # hostnamectl

   Static hostname: linux-k6k1

         Icon name: computer-vm

           Chassis: vm

        Machine ID: 1dec0ea9fa9f49aa910a0f6d44dd0d9c

           Boot ID: e043107e53a644e2aecf506f1405637b

    Virtualization: vmware

  Operating System: openSUSE Leap 15.1

       CPE OS Name: cpe:/o:opensuse:leap:15.1

            Kernel: Linux 4.12.14-lp151.28.36-default

      Architecture: x86-64

linux-k6k1:~ # cat /etc/hostname

linux-k6k1

 

Hostname 설정

linux-k6k1:~ # hostnamectl set-hostname hanadb

 

변경된 Hostname 확인

linux-k6k1:~ # hostname

hanadb

linux-k6k1:~ # hostnamectl

   Static hostname: hanadb

         Icon name: computer-vm

           Chassis: vm

        Machine ID: 1dec0ea9fa9f49aa910a0f6d44dd0d9c

           Boot ID: e043107e53a644e2aecf506f1405637b

    Virtualization: vmware

  Operating System: openSUSE Leap 15.1

       CPE OS Name: cpe:/o:opensuse:leap:15.1

            Kernel: Linux 4.12.14-lp151.28.36-default

      Architecture: x86-64

linux-k6k1:~ # cat /etc/hostname

hanadb

 

참고자료:

https://www.cyberciti.biz/faq/opensuse-linux-change-hostname-computer-name-command/

+ Recent posts