linuxにはnscdというデーモンが動いています。地味ですがパワフルな奴です。
hostsを変えたのに、DNSを変えたのに、リゾルバを変えたのに、、、、、反映されないよ!
というような時にはこいつの仕業かも知れません。
nscdとは「ネームサービスキャッシュデーモン(Name Chache Service Deamon)」の略で、その名の通り、一般的なネームサービスに必要な多くのものをキャッシュとして提供するデーモンです。
/etc/init.d/nscd status で起動している場合、hostsやDNSを変更してもすぐに切り替わりません。
そのときは、再起動が必要です。しっかりと、stop、startをしましょう。
/etc/init.d/nscd stop /etc/init.d/nscd start
コマンドがインストールされていないときは、
yum install nscd
で可能です。
コマンドは以下のオプションが使えます。
-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
ちなみに、設定ファイルはこちら。
less /etc/nscd.conf
詳しくは、manページを見るのが一番良いです。
[amazonjs asin=”4797369841″ locale=”JP” title=”新Linux/UNIX入門 第3版 (林晴比古実用マスターシリーズ)”]