Skip to content

Instantly share code, notes, and snippets.

@g-empr
Last active November 7, 2019 03:56
Show Gist options
  • Save g-empr/bc5fc8eaa6297f41693e27f9c5bdc0d5 to your computer and use it in GitHub Desktop.
Save g-empr/bc5fc8eaa6297f41693e27f9c5bdc0d5 to your computer and use it in GitHub Desktop.

hostsとは

リニューアル公開前(DNS切り替え前)のサイトを確認する際に、公開時のドメインでアクセスしないと正しく表示できないケースがあります。 そこで、PC内にある「hostsファイル」を編集することで、DNS情報を参照せずに設定したPC上のブラウザからドメイン名で新しいサーバにアクセスすることができます。

参考: DNS切り替え前にドメイン名で新サーバにアクセスする「hostsファイルの変更方法」

設定手順(Mac版)

sudo vi ~/etc/hosts

開いたら各種host情報を書き込んで保存して終了.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment