
Windows 11 の「メモ帳」を使用して hosts ファイルを表示する方法です。
hosts

Windows 11 の標準機能とも言える「メモ帳」を使用して hosts ファイルを表示します。
hosts ファイルの実体
hosts ファイルの実体は、次のファイルです:
C:\Windows\System32\drivers\etc\hosts
以下のような内容が記載されています:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
hosts をメモ帳で表示する
メモ帳を使用して閲覧ができます。
メモ帳での確認が終わったら右上の[X]ボタンで閉じます。この際、保存するか聞かれた場合は[いいえ]と回答し、保存しないようにします。
※ hosts ファイルは重要ファイルのため、閲覧を目的とした本記事の手順では、通常、保存できません。hosts ファイルの内容の更新が必要な場合は、ページ下部をご参照ください。
方法 A

[CTRL]キーを押しながら[R]キーを押して「ファイル名を指定して実行」を表示させ、次の内容を入力し、[OK]をクリックします:
C:\Windows\System32\drivers\etc\hosts

アプリ選択画面が表示された場合は、[メモ帳]を選択して開きます。
※アプリ選択画面は環境により異なります

hosts が表示されます。

(参考) [スタート]を[右クリック]して「ファイル名を指定して実行」をクリックする方法もあります
方法 B
方法 B は、方法 A の変形です。

ファイル名を指定して実行で入力する際、予めメモ帳を指定して hosts ファイルを開く場合は、次の内容を入力します:
notepad C:\Windows\System32\drivers\etc\hosts

hosts が表示されます。
方法 C
起動しているメモ帳から hosts ファイルを開くこともできます。

[ファイル]から[開く]をクリックします。

ファイル名入力欄に次の内容を入力して[OK]をクリックします:
C:\Windows\System32\drivers\etc\hosts

hosts が表示されます。
エラー例

C:\Windows\System32\drivers\etc\hosts.txt
この場所に保存するアクセス許可がありません。
管理者に連絡してアクセス許可を取得してください。
代わりに[ドキュメント]フォルダーに保存しますか?
この表示は、メモ帳で hosts ファイルに変更を加えようとした際に表示されます。hosts ファイルはシステムにとって重要なファイルですから表示して確認するにとどめ、変更を保存してはいけません。もし、変更を加えたい場合は、次のサポート記事をご参照ください:
注意
- 本操作例は、Windows 11 のメモ帳を使用して hosts ファイルを表示するものです
スポンサードリンク