LoginSignup
8
9

More than 5 years have passed since last update.

DNSのキャッシュをクリアする

Posted at

hosts書き換えたのに変更前のIPを参照していて困った時に使えるコマンド。
これでもうCtrl+F5の連打はしなくていいw

for Linux

$ /usr/sbin/nscd -i hosts

nscdName Service Cache Daemon(ねーむさーびすきゃっしゅでーもん)
-i --invalidate=TABLE:Invalidate the specified cache(指定されたキャッシュを無効にする)
→ つまり、このコマンドは「hostsのキャッシュを無効にする」という意味
pingなどで参照先の確認が出来る。

for Windows

> ipconfig /flushdns

「DNSリゾルバーキャッシュを破棄します」(--helpより)
ipconfig /displaydnsで確認出来る。

8
9
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
8
9