nscd」カテゴリーアーカイブ




DNSやhostsなど名前解決の変更が反映されない時は、nscdを再起動してみよう!




投稿日:

linuxにはnscdというデーモンが動いています。地味ですがパワフルな奴です。

hostsを変えたのに、DNSを変えたのに、リゾルバを変えたのに、、、、、反映されないよ!

というような時にはこいつの仕業かも知れません。

nscdとは「ネームサービスキャッシュデーモン(Name Chache Service Deamon)」の略で、その名の通り、一般的なネームサービスに必要な多くのものをキャッシュとして提供するデーモンです。

/etc/init.d/nscd status で起動している場合、hostsやDNSを変更してもすぐに切り替わりません。
そのときは、再起動が必要です。しっかりと、stop、startをしましょう。

[html]/etc/init.d/nscd stop
/etc/init.d/nscd start[/html]

コマンドがインストールされていないときは、
[html]yum install nscd [/html]
で可能です。

コマンドは以下のオプションが使えます。
[html]
-d, –debug Do not fork and display messages on the currenttty
-f, –config-file=NAME Read configuration data from NAME
-g, –statistics Print current configuration statistics
-i, –invalidate=TABLE Invalidate the specified cache
-K, –shutdown Shut the server down
-t, –nthreads=NUMBER Start NUMBER threads
-?, –help Give this help list
–usage Give a short usage message
-V, –version Print program version
[/html]

ちなみに、設定ファイルはこちら。
[html]less /etc/nscd.conf[/html]

詳しくは、manページを見るのが一番良いです。

[amazonjs asin=”4797369841″ locale=”JP” title=”新Linux/UNIX入門 第3版 (林晴比古実用マスターシリーズ)”]