httpd: apr_sockaddr_info_get() failed が Apache で発生

2011/02/03

Apache を再起動させたところ、以下のエラーが発生した。

[root@centkun ~]# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: httpd: apr_sockaddr_info_get() failed for web001.masudaq.local
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ]

Web サーバーとしての動作には、問題ないのだが、やっぱり気持ち悪い。

要約すると、"web001.masudaq.local " が、名前解決できず、IP アドレスが取得できないとのエラー。

nslookup してみると、やっぱり名前解決できてない。

[root@centkun ~]# nslookup web001.masudaq.local
Server: 192.168.11.1
Address: 192.168.11.1#53

** server can't find web001.masudaq.local: NXDOMAIN

そういえば、"web001.masudaq.local " の参照先 DNS を内向け DNS から、ルーターの DNS に変更したんだった。

内向け DNS には、"web001.masudaq.local" を A レコードを定義していた。

ルーターの DNS には、 A レコードを追加できないので、今回は、hosts にローカルホスト名のレコードを追加する。

[root@centkun~]# vi /etc/hosts

# 以下を追加
192.168.11.7 web001.masudaq.local

正常に Apache の起動ができた。

[root@centkun ~]# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]

DNS の移行には気を付けよう。当たり前だけどね。