1
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.

Windowsのhostsファイルで特定URLとの通信禁止

Last updated at Posted at 2023-08-02

やり方

『hosts』ファイルは下記にあります。

C:\Windows\System32\drivers\etc

『etc』フォルダーはシステムフォルダーなので、中のファイルを簡単に変更できないです。
なので『hosts』ファイルをダウンロードフォルダーなどの『ファイル編集ができる場所』にコピー。

コピーした『hosts』ファイルに対して、下記のように 0.0.0.0 アクセス禁止にしたいサイトURL を追記。
image.png

変更した『hosts』ファイルを『etc』フォルダーに上書きで戻してあげます。
下記のような画面が出てきます。
image.png

『hosts』ファイル変更後に再起動は不要です。
変更は即反映されます。

ファイアウォールでも設定可

特定IPアドレスとの通信遮断はhostsファイルではなく、ファイアウォールでも設定可です。

参考サイトさん

バージョン

Microsoft Windows [Version 10.0.19045.3271]

1
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
1
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?