Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

DNSキャッシュをクリアする方法 (Mac, Windows, Chrome)

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

DNSキャッシュのクリアを求められたことがあるだろうか?

このトラブルシューティングのヒントは、特にDNSの変更後にサイトの最新バージョンを取得するのに役立ちます。

DNS情報は、ブラウザーにサイトの場所を知らせます。コンピューターはこの情報をキャッシュに保存し、ブラウザーに正しい方向をすばやく示すことができます。

この投稿では、Mac、Windows、ChromeでDNSキャッシュをクリアする方法をご紹介します。これにより、端末に保存されているDNSレコードを簡単に更新でき、サイトのトラブルシューティングに役立ちます。

Easily clear DNS cache in macOS, Windows, and Chrome

このガイドで取り上げる内容を簡単に紹介しよう:

DNSキャッシュとは何か?

DNSキャッシュとは、コンピューターに保存されているアドレス帳のようなものです。アクセスした各サイトのDNS(ドメインネームサーバー)情報が含まれています。

DNSは、コンピューターにドメイン名に関連付けられているIPアドレスを知らせる技術です。さらに詳しく知りたい方は、ドメイン名の仕組みについてのガイドをご覧ください。

DNS情報をローカルDNSキャッシュに保存することで、ブラウザーが素早くサイトを見つけることができる。

ブラウザーにサイトのアドレスを入力すると、まずローカルキャッシュ内のDNS情報を探します。もしDNSが見つかれば、DNSキャッシュを使ってサイトを訪問します。

一方、ローカルDNSキャッシュに情報がない場合、ブラウザーはインターネット上の他のDNSサーバーから情報を取得する。

これにより、ブラウザーは、サイトを訪問するたびに、インターネット上のウェブサイトを特定するために必要なDNS情報を取得するための最短ルートを取るようになります。

How domain names and DNS work

しかし、これは時にトラブルを引き起こすこともある。

たとえば、WordPressサイトを新しいドメイン名に移動したり、WordPressを新しいホスティングサービスに移動したりする場合、コンピューター上でDNS情報がすぐに更新されず、古いサイトにアクセスしてしまったり、見つからないエラーが表示されたりすることがあります。

いずれ更新されるだろうが、すぐにDNSキャッシュをクリアできるのに、なぜ待つのか?

さまざまなプラットフォームでDNSキャッシュをクリアする方法を見てみよう。

WindowsでDNSキャッシュをクリアする方法

ここでは、WindowsコンピューターでDNSキャッシュをクリアする方法を説明します。

まず、「スタート」ボタンをクリックし、CMD(コマンドプロンプト)ツールを選択します。

Opening command prompt in Windows

これでコマンドプロンプトウィンドウが起動する。その中に、以下のテキストを入力する必要がある:

ipconfig /flushdns
Clearing DNS cache in Windows

Enter」キーを押してコマンドを実行すると、WindowsがDNSキャッシュをフラッシュする。

これですべてです。これで、更新されたDNS情報を取得するためのサイト訪問を再開することができます。

macOSでDNSキャッシュをクリアする方法

Macコンピューターをお使いの場合は、以下の手順でDNSキャッシュをクリアできます。

まず、Terminalアプリを起動する必要があります。Launchpadの「Other」フォルダーにあります。また、Finderを開き、アプリケーション ” ユーティリティフォルダーに行っても起動できます。

Launching terminal

ターミナル・ウィンドウが起動するので、そこで以下のコマンドを入力する:

sudo killall -HUP mDNSResponder
Clearing DNS cache using terminal on macOS

macOSアカウントのパスワードを入力するよう求められます。これはコンピューターにログインする際に使用するパスワードと同じです。

その後、コンピューターがDNSキャッシュをフラッシュします。これで、サイトにアクセスして最新のDNS情報を取得できるようになります。

ChromeでDNSキャッシュをクリアする方法

Google Chromeは独自のDNSキャッシュも保持しており、オペレーティングシステムが保存するDNSキャッシュとは区切られています。

メインブラウザとしてGoogle Chromeを使用している場合は、ChromeのDNSキャッシュもクリアする必要があります。

まず、ブラウザーのアドレスバーに以下のアドレスを入力し、キーボードの「Enter」キーを押します:

chrome://net-internals/#dns
Clearing the Chrome DNS Cache

Chromeのネット内部設定ページが表示されます。

ここから「ホスティングサービスキャッシュをクリア」ボタンをクリックすると、クロームがDNSキャッシュをクリアします。

DNSの更新を確認する方法

WordPressサイトをホスティングサービスに移転する場合、またはドメイン登録を新しいドメイン登録業者に移管する場合、DNS設定を変更し、新しい場所を指定する必要があります。

ドメイン設定にこれらの変更を適用すると、その変更がインターネット全体に反映されるまでしばらく時間がかかります。数時間から数日かかります。

この間、ドメインは古い場所を指すこともあれば、新しい場所を指すこともあります。これは、あなたの地理的な位置と、ブラウザーが指示を求めるDNSサーバーに依存します。

DNSチェッカーのようなオンラインツールを使って、これらのDNSの変更がどのように世界中に伝播しているかを確認することができます。

ドメイン名を入力するだけで、世界中のさまざまな地域からDNSを取得します。

Check for DNS updates

すべての場所で同じIPアドレスが緑色のチェックマークで表示されていれば、あなたが行ったDNSの変更がインターネット上で更新されたことを意味します。

DNSキャッシュとブラウザーキャッシュの違いとは?

ここで、DNSキャッシュはブラウザーキャッシュとは異なることに留意してほしい。

ブラウザーは、繰り返し訪問する際に素早くページを読み込むために、多くのサイトデータを一時キャッシュに保存します。DNSキャッシュにはそれらのサイトが存在するIPアドレスが含まれています。

更新したページが表示されない場合は、ブラウザーキャッシュをクリアしてください。

主要なブラウザーすべてにおいて、ブラウザーのキャッシュをクリアする方法をステップ・バイ・ステップでご紹介しています。

WordPressのキャッシュに関するエキスパートガイド

DNSキャッシュをクリアする方法はお分かりいただけたと思いますが、WordPressのその他のキャッシュに関する投稿もご覧ください。

この投稿が、さまざまな端末でDNSキャッシュを簡単にクリアする方法のお役に立てば幸いです。WordPress のパフォーマンスを高速化する方法、またはサイトを成長させる最高の WordPress プラグインを専門家が選ぶガイドもご覧ください。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

10件のコメント返信を残す

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    We recently dealt with one of our customers that after changing the DNS records for the domain, he still saw the original website and we saw the new one. We couldn’t figure out what the problem was because we didn’t think it could be this cache (we cleared all other caches before). Only when we cleared the DNS cache using these commands under Windows, the pages were displayed correctly in the browser’s anonymous mode. Subsequently, they also worked in classic mode. So clearing the DNS cache saved us quite a bit of headache and looking for the problem elsewhere.

  3. THANKGOD JONATHAN says

    So browser cache and DNS cache are two different things. I was really foolling myself and didn’t think about it. All I does is to clear my browser cache and thought it’s all. Thank you for the article.

  4. Moinuddin Waheed says

    I have been in trouble for this mistake many times that is getting confused DNS cache with browser cache and vice versa.
    I updated the website and was not seeing the update on my browser.
    Then I cleared the browser cache and it worked well.
    having said that if we clear the DNS cache with command line , what time it takes to save new domain as cache to load the website faster?
    is it recommended to flush the DNS cache regularly?

    • Jiří Vaněk says

      Storing a new domain in the cache is a matter of first loading after clearing the cache. The domain is loaded and the DNS cache saves it. There is nothing more to it. As for some regular cache clearing, it’s not really necessary. Personally, I have never needed to delete the DNS cache, except in cases where, for example, the DNS records on the domain were changed. I also did not know this at first and looked for the error elsewhere. However, in my opinion, you do not need regular deletion, unless you are solving a problem where the DNS cache could play a role.

    • WPBeginner Support says

      It will try to bring in the new content directly and unless there is another caching that causes a problem, you should see the correct site.

      You should not need to normally flush your DNS cache.

      管理者

      • Moinuddin Waheed says

        Thanks wpbeginner for clearing confusion regarding clearing the DNS cache.
        I was confusing it with the browser cache and thought that the new updates will be shown only when we clear the browser cache.
        it means we can flush the DNS as and when we think we should.

  5. David says

    The articles I have read here in wpbeginner are exceptionally simple (without feeling simplified), clear, informative and most helpful. Thank you!

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。