それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

sudo: unable to resolve hostが出たので対処

めったに出ること無いんだけどなぁ。

sudo: unable to resolve hostが出た。

takuya@takuya1st-ubuntu001:/var/www$ sudo visudo
sudo: unable to resolve host takuya1st-ubuntu001

Windows AzureUbuntuインスタンスで頻発した

resolvと書いてある通り、原因はホスト名の解決にある。

/etc/hosts
127.0.0.1 localhost
127.0.1.1 takuya1st-ubuntu001

を上記のように変更したら出来た。けどスッキリはないなぁ。hostname と DNS関連かなぁ

念の為確認

/etc/hostname
takuya@takuya1st-ubuntu001:~$ cat /etc/hostname 
takuya1st-linux

/etc/hosts.conf

takuya@takuya1st-ubuntu001:~$ cat /etc/host.conf 
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on

うーん、resolve.conf でWindowsAzureのローカルドメインでも当ててあるのかなぁ。