centOS 8 hostname 변경하기

  1. OCI(Oracle Cloud Infrastructure)에 centOS 8을 셋팅하고 있는중에 hostname을 변경하려고 하였지만 왠일인지 제부팅을 하고나면 다시 초기값으로 복구 되었다.
# vi /etc/oci-hostname.conf

# PRESERVE_HOSTINFO=0
PRESERVE_HOSTINFO=2

# hostnamectl set-hotname new-my-hostnameCode language: PHP (php)

2. 위의 파일의 PRESERVE_HOSTINFO=0 옵션값을 0에서 2로 변경해주면 된다.

3. 자세한 옵션값은 파일 주석을 참조하면 된다.

# This configuration file controls the hostname persistence behavior for Oracle Linux
# compute instance on Oracle Cloud Infrastructure (formerly Baremetal Cloud Services)
# Set PRESERVE_HOSTINFO to one of the following values
#   0 -- default behavior to update hostname, /etc/hosts and /etc/resolv.conf to 
#        reflect the hostname set during instance creation from the metadata service
#   1 -- preserve user configured hostname across reboots; update /etc/hosts and 
#           /etc/resolv.conf from the metadata service  
#   2 -- preserve user configured hostname across instance reboots; no custom  
#        changes to /etc/hosts and /etc/resolv.conf from the metadata service,
#        but dhclient will still overwrite /etc/resolv.conf
#   3 -- preserve hostname and /etc/hosts entries across instance reboots; 
#        update /etc/resolv.conf from instance metadata serviceCode language: PHP (php)

댓글 달기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

9 + 10 =