Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Sudo: Unable to resolve host: hostname

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Location
    Nashville
    Beans
    7
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Exclamation Sudo: Unable to resolve host: hostname

    I don't know if this has been talked about yet, since I could not find it anywhere in the forums...
    I cannot seem to use 'sudo <command>' without getting 'sudo:unable to resolve host: hostname.
    Code:
    leech@stephanie:~/Templates$ sudo ./configure
    sudo: unable to resolve host stephanie

    I have even tried to use this command as the root user to no avail. I am running Hardy x32 NOT from an upgrade. I don't have anything non-standard install besides AWN and Screenlets, which I installed through 'Synaptic'.
    Any help on this would be graciously accepted.

  2. #2
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Sudo: Unable to resolve host: hostname

    I ran into this problem yesterday, after playing around with Samba. Samba had modified the entry in /etc/hosts for my machine.

    Go to System -> Administration -> Network -> Hosts

    Check the entry for 127.0.1.1 and see if it matches the hostname of stephanie. If not, change it back to stephanie.

  3. #3
    Join Date
    Jan 2008
    Beans
    7

    Re: Sudo: Unable to resolve host: hostname

    I had the same problem. The Monicker's solution has solved it. Thanks.

  4. #4
    Join Date
    Mar 2008
    Beans
    6

    Talking Re: Sudo: Unable to resolve host: hostname

    Quote Originally Posted by Monicker View Post
    I ran into this problem yesterday, after playing around with Samba. Samba had modified the entry in /etc/hosts for my machine.

    Go to System -> Administration -> Network -> Hosts

    Check the entry for 127.0.1.1 and see if it matches the hostname of stephanie. If not, change it back to stephanie.
    oh my, thanks so much. I was searching the net for two hours now until I found this post. now everything works as it should.

    karma + for you Monicker


    Edit: I can't find the Thanks option, where is it hidden?
    Last edited by ublackwhiteu; August 17th, 2008 at 09:54 AM. Reason: blindness

  5. #5
    Join Date
    Jul 2008
    Location
    CA
    Beans
    29
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Sudo: Unable to resolve host: hostname

    Quote Originally Posted by ublackwhiteu View Post
    oh my, thanks so much. [...] karma + for you Monicker
    Edit: I can't find the Thanks option, where is it hidden?
    ...Yeah, I was wondering the same thing!! Especially, since YOUR post has the "thanks" icon (lower right, a little yellow star + blue badge, next to "quote"/"reply") -- and the other posts do not..!?

    Then, I found this in one of the forum how-to's: "All about the Thanks feature":
    "A few notes:
    * The Thanks feature doesn't show up on posts that were in existance before it was implemented.
    * The option to remove the Thanks shows up after you Thank someone.
    * Not all forums have this feature.
    * The ability to thank a post seems to disappear after 60 days."
    cheers,
    -m

  6. #6
    Join Date
    Jul 2009
    Beans
    8

    Re: Sudo: Unable to resolve host: hostname

    i am using a vps and it comes up with this can you help me please

  7. #7
    Join Date
    May 2008
    Beans
    5

    Re: Sudo: Unable to resolve host: hostname

    HI still the same problem in /etc/hosts it is same please help me

  8. #8
    Join Date
    May 2008
    Beans
    5

    Re: Sudo: Unable to resolve host: hostname

    hi still same problem /etc/hosts is right can you help me

  9. #9
    Join Date
    May 2007
    Location
    South Florida
    Beans
    127
    Distro
    Ubuntu Development Release

    Re: Sudo: Unable to resolve host: hostname

    I'm running Karmic on an ASUS EeePC and I had a similar problem and solved it by doing the following:

    I originally had a hostname of - ASUS EeePC

    I think the space between the word was the problem. I looked at all the files related to hostname:

    Code:
    cat /etc/hosts
    Code:
    cat /etc/hostname
    Code:
    hostname --long
    And they all had the same hostname 'ASUS EeePC' . . . so I decided to make a change and see what happened.

    I edited the file /etc/hosts and /etc/hostname and changed each to just - 'EeePC' (w/o the quotes) without any spaces.

    I rebooted and everything was working fine . . . other parts of the files got updated/modified to add the 'localhost' and 'local-domain' elements discussed in this thread and in others. And no more sudo error messages.
    Last edited by TunaCanTommy; October 15th, 2009 at 09:50 PM. Reason: Clarity

  10. #10
    Join Date
    Mar 2009
    Location
    Goldendale, WA
    Beans
    17
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Sudo: Unable to resolve host: hostname

    Worked perfectly for me... kudos TunaCanTommy

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •