
Originally Posted by
Dejavou42
unfortunately that thread is still discussing the same problem that I mentioned above (/etc/hosts /etc/hostname difference), which is also not the problem that I am experiencing.
...Have you tried the proposed solution? Your hosts file still looks basically incomplete; it's NOT the same thing as I've posted.

Originally Posted by
Dejavou42
As said in a post above, this would make sudo commands not work. My sudo commands all work, as well as administrative functions, it just gives me that error message.
Well, this is not true; I've just tried this, myself. I do get the warning message, but sudo works. I'll post exactly what I have (only the hostname / domain name changed to protect the innocent):
In both cases, I have my hostname:
Code:
$ cat /etc/hostname
myhost
=== good configuration ====
Code:
$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost myhost
127.0.1.1 myhost myhost.mydomain.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
$ whoami
userfoo
$ sudo ls
[sudo] password for userfoo:
file1 file2 ....
=== bad configuration (slightly different, yes, but it causes the problem) ====
Code:
$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 myhost.mydomain.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
$ sudo ls
sudo: unable to resolve host myhost
file1 file2 ...
(Note: it doesn't ask my passwd the second time, since it remembered that I had just run a sudo command).
And, auth.log,
Code:
/var/log/auth.log:Aug 21 10:49:19 myhost sudo: userfoo : unable to resolve host myhost
So, your problem may be completely unrelated, but this still sounds quite similar like what you're experiencing.
Try posting your updated hosts file that tries this suggested solution, and you might get people looking for other possible solutions ... but until you try this (until we know you've tried this), there's not much reason to pursue & post alternative solutions. Nothing is a substitute for physical hands-on the keyboard, so we can only suggest things & hope the feedback you provide is sensible (cause/effect from our suggestions) & can generate new ideas.
Thanks & good luck,
-m
ps: btw, you might also check the sudo config,
Code:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
Bookmarks