18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ubuntu18.04 LTS Serverインストール時hostnameを恒久的に変更する

Posted at

ubuntu18.04でhostnameを変更する

前提条件

手順

  1. /etc/cloud/cloud.cfgpreserve_hostnameをtrueにする
    • preserve_hostname: true
  2. hostnamectlからhostnameを変更
    • hostnamectl set-hostname yourhostname
  3. rebootして設定が反映されているか確認

どうして

  • (私の環境だけかもしれないが)Ubuntu18.04だとcloud.cfgの変更をしないとhostnameの変更ができなかった
    • 一応基盤の差じゃないかと思ったのでOpenstackとESXi双方で検証した
  • Ubuntu16.04でもデフォルトではpreserve_hostname: falseになっているものの、ここをtrueに変えずともhostnameの変更がreboot後も維持できる。

参考

18
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?