![自身のホスト名の解決に問題があります](https://rvso.com/image/1114440/%E8%87%AA%E8%BA%AB%E3%81%AE%E3%83%9B%E3%82%B9%E3%83%88%E5%90%8D%E3%81%AE%E8%A7%A3%E6%B1%BA%E3%81%AB%E5%95%8F%E9%A1%8C%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99.png)
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