linuxでhostnameコマンドを叩いた際のホスト名がどの設定を参照しているのかが分かりません。
hostsファイルや/etc/sysconfig/networkの設定を見ても、コマンド結果のhostnameと異なります。
httpd.confではServerNameは指定しておらず、vhostsファイルを読み込んでいますが、そこで設定しているhostnameとも異なります。
ネットワーク、アパッチの再起動もしましたが結果が変わりません。
どのような原因が考えられますでしょうか?
よろしくお願いいたします。
man hostnameすると
FILES
/etc/hostname Historically this file was supposed to only contain the hostname and not the full canonical FQDN. Nowadays most software is able to cope with a full FQDN here.
This file is read at boot time by the system initialization scripts to set the hostname.
と出てきますよ。
hostnameコマンドは引数なしで呼ぶとgethostname(2)を使用してホスト名を表示します。
これは起動時などにsethostname(2)で設定されたホスト名です。
情報ありがとうございます。
こちら参考にさせていただきます。
回答2件
あなたの回答
tips
プレビュー