自身のホスト名の解決に問題があります

自身のホスト名の解決に問題があります

10.04 LTS サーバーを実行しています。この問題を解決できません: 「ホスト serverubuntu を解決できません」。

推奨されている解決策をすべて試しましたが、どれも機能しませんでした。この問題は、ホストおよびホスト名ファイルの設定が間違っているために発生する可能性があると読みました。

これらのファイルのコンテストは次のとおりです。

ファイル: ホスト名

serverubuntu

ファイル: ホスト

127.0.0.1       localhost
127.0.1.1       serverubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

注: hosts ファイルの 2 行目にいくつかの異なるエントリを試しました。

127.0.1.1  serverubuntu  serverubuntu.hvc.rr.com
127.0.1.1  serverubuntu  serverubuntu.hvc.rr.com serverubuntu

どれも機能しませんでした。

私のサーバーには静的IPアドレス192.168.1.199が割り当てられています

答え1

/etc/hostsファイルには次のように記述します。

127.0.0.1       localhost
127.0.1.1       serverubuntu//change this to 127.0.0.1
192.168.1.199   serverubuntu//add your static IP


# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

関連情報