저는 최근 Digital Ocean에 다음과 같은 이름의 물방울 서버를 만들었습니다.
ubuntu-2gb-nyc3-01-2016-03-13
그런 다음 Digital Ocean 제어판의 서버에서 exchange.mydomain.com
.
또한 다음 명령을 수행했습니다.
sudo echo "exchange.mydomain.com" > /etc/hostname
그리고 그것을 수행하여 변경 확인 nano /etc/hostname
그러나 hostname
명령 프롬프트에 입력하면 값이 업데이트를 반영하지 않습니다. 문제는 무엇이며 어떻게 해결합니까?
사용을 systemd
사용 hostnamectl
하여 호스트 이름을 설정하는 배포판 :
$ sudo hostnamectl set-hostname exchange.mydomain.com
셸 프롬프트에서 변경 사항을 보려면 로그 오프했다가 다시 로그인해야하지만 hostname
명령을 실행하자마자 명령이 변경 사항을 표시합니다.
$ sudo hostnamectl --help
hostnamectl [OPTIONS...] COMMAND ...
Query or change system hostname.
-h --help Show this help
--version Show package version
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
-M --machine=CONTAINER Operate on local container
--transient Only set transient hostname
--static Only set static hostname
--pretty Only set pretty hostname
Commands:
status Show current hostname settings
set-hostname NAME Set system hostname
set-icon-name NAME Set icon name for host
set-chassis NAME Set chassis type for host
set-deployment NAME Set deployment environment for host
set-location NAME Set location for host
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다