0
0

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 3 years have passed since last update.

Vagrantでホスト名を設定する。

Posted at

環境

Vagrant 2.2.10
centos7
Mac OS Catalina 10.15.6
apache 2.4.6

vagrant-hostupdaterインストール

$ vagrant plugin install vagrant-hostsupdater

Vagrantfileに設定する

config.vm.network :private_network, ip: "192.168.3.10"
config.vm.hostname = "ホスト名"

vagrantをリロードする

$ vagrant reload

パスワードを求められるので入力する。
その後、Vagrantfileで指定したホスト名に、ブラウザでアクセスできるようになる。
/etc/hostsファイルを確認すると、ホスト名の情報が入力されている。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?