LinuxでDNSキャッシュを消去する

LinuxでDNSキャッシュを消去する

私のラップトップはLinuxを使用しており、そのURLを使用して特定のWebサイトにアクセスできないため、そのsudo /etc/init.d/nscd restartURLを使用してDNSキャッシュを消去していますが、URLはまだFirefoxで「サーバーが見つかりません」を引き起こします。 Chromeも試してみましたが、まだ機能していません。他の友達はページを見ることができますが、私は見ることができません。それでは、この状況の主な理由は何ですか?他のウェブサイトもよく閲覧できます。

奇妙なことは、特定のURLのIPアドレスを試してみると、他の人が見るものとは異なるページが表示されることです。

この問題にご協力いただきありがとうございます。

ベストアンサー1

bind誤って実行しない限り、nscdにある設定ファイルを確認する必要があります/etc/nscd.conf

保持されたキャッシュが一覧表示されます。

 enable-cache            hosts           yes
 positive-time-to-live   hosts           3600
 .......

# nscd -?

-g, --statistics Print current configuration statistics

-i, --invalidate=TABLE Invalidate the specified cache

nscd -g

    hosts cache:

        yes  cache is enabled
         no  cache is persistent
        yes  cache is shared
        211  suggested size
     216064  total data pool size
        384  used data pool size
        600  seconds time to live for positive entries
          0  seconds time to live for negative entries
          0  cache hits on positive entries
          0  cache hits on negative entries
        128  cache misses on positive entries
          0  cache misses on negative entries
          0% cache hit rate
          3  current number of cached values
          7  maximum number of cached values
          2  maximum chain length searched
          0  number of delays on rdlock
          0  number of delays on wrlock
          0  memory allocations failed
        yes  check /etc/{hosts,resolv.conf} for changes

# nscd -i hosts

これによりキャッシュが無効になります。

nscd -g ただし、この操作を実行しても再nscd起動後にリフレッシュすると、ホストエントリは変更されませんでした。

service nscd restart

    hosts cache:

        yes  cache is enabled
         no  cache is persistent
        yes  cache is shared
        211  suggested size
     216064  total data pool size
          0  used data pool size
        600  seconds time to live for positive entries
          0  seconds time to live for negative entries
          0  cache hits on positive entries
          0  cache hits on negative entries
          0  cache misses on positive entries
          0  cache misses on negative entries
          0% cache hit rate
          0  current number of cached values
          0  maximum number of cached values
          0  maximum chain length searched
          0  number of delays on rdlock
          0  number of delays on wrlock
          0  memory allocations failed
        yes  check /etc/{hosts,resolv.conf} for changes

nscdキャッシュを空にする唯一の方法であるバインドを実行しない限り、データベースを見つけて削除する方法がないため、他の問題が発生する可能性があります。 IP確認のためのトラブルシューティングプロセスに従ってください。あなたの質問についてのコメントでこれらのいくつかを説明しました。

以下は非常に良いLinux Journalの記事へのリンクです。ネットワークのトラブルシューティング

おすすめ記事