Public bug reported:

I stumbled upon this error after upgrading to 8.04 yesterday and while
trying to use sudo. It have me the following error,

sudo: unable to resolve hostname <HOSTNAME>

I checked the /etc/hosts file and found the following entry,

127.0.0.1 <HOSTNAME>.<DOMAINNAME> <HOSTNAME>.<DOMAINNAME>

I removed the <DOMAINNAME> from the second occurrence and things started
working fine.

However when I switch the network settings through System ->
Administration -> Network. Again the same setting reappeared. I though
that the error might be with the hosts tab in the switched setting and
removed the domain name from the hosts tab and clicked apply. But the
/etc/hosts wasn't changed.

Here is a detailed procedure to reproduce this issue,
- Go to System -> Admin -> Network
- Click unlock and enter your password
- Select a setting from the Location drop down
- Go to hosts tab
- Select the "127.0.0.1 <YOURHOSTNAME>.<DOMAINNAME> entry and click "Properties"
- Append your host name without domain name to the value part and click "Ok" 
and then "Apply"
- Do cat /etc/hosts and notice that the /etc/hosts has wrong entry as,
127.0.0.1 <HOSTNAME>.<DOMAINNAME> <HOSTNAME>.<DOMAINNAME>
instead of
127.0.0.1 <HOSTNAME>.<DOMAINNAME> <HOSTNAME>

The only way I am able to remove it is using the root account (I had
once set the password using "sudo passwd" when /etc/hosts was correct)

Here is my OS version info,
> uname -a
Linux lap432 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 
GNU/Linux

** Affects: ubuntu
     Importance: Undecided
         Status: New

-- 
Editing /etc/hosts through system -> administration -> network automatically 
appends domain name
https://bugs.launchpad.net/bugs/223448
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to