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 1 year has passed since last update.

メモ:hostsファイルとは

Last updated at Posted at 2023-03-29

hostsファイルとは?

ホスト名とIPアドレスの対応を書いておくファイル。
OSの設定ファイルのひとつ。

DNSサーバはドメイン名とIPアドレスを行うものであるが、hostsファイルはDNSよりも先に参照される。
※DNSが登場する以前に使われていた仕組みでもある。
※hostsファイルとは、ローカル環境だけのDNSとも言える。

hostsファイルの格納場所

C:\Windows\System32\drivers\etc\hosts

windows+rで名前欄にdriversと打つと、該当フォルダを一発で開くことができる。

編集の仕方

管理者権限でテキストエディタ(メモ帳など)を起動させておき、ファイルを開く。

更新した場合、PCの再起動は不要で、即設定が適用される。
(しかし、今までに何回か、設定がなかなか適用されていないとしか思えない事象に遭ったことあり)

備考

同じホスト名について重複で記載がされている場合、上に書いてある方が適用される模様。

192.168.0.0.1 foo
127.0.0.1 foo
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?