Results 1 to 5 of 5

Thread: hostname (none)

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Sweden
    Beans
    36
    Distro
    Ubuntu 11.04 Natty Narwhal

    hostname (none)

    Hello,

    Just upgraded from Ubuntu Server 9.04 to 10.04 and in the process my hostname was lost.
    Code:
    $ hostname
    (none)
     
    $ uname -n
    (none)
    Although configure file looks fine:
    Code:
    $ cat /etc/hostname
    bob_ubuntu
     
    $ cat /etc/hosts
    127.0.0.1 localhost
    127.0.1.1 bob_ubuntu.domain.com bob_ubuntu
    
    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
    Have set hostname with:
    Code:
    $ sudo hostname bob_ubuntu
    hostname: the specified hostname is invalid
    But doing it this way you cant use '_' ..
    Any suggestions?

    Regards, cbob

  2. #2
    Join Date
    Oct 2007
    Beans
    220
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: hostname (none)

    I though you couldn't have an underscore in the hostname. Try changing the hostname to bob-ubuntu and run sudo /etc/init.d/hostname.sh start.

    Then check hostname - you may need a reboot

    Rgds
    Chris

  3. #3
    Join Date
    Dec 2009
    Location
    Sweden
    Beans
    36
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: hostname (none)

    This does work, changing hostname to 'bob-ubuntu' but before my upgrade it was fine to have underscore.

    I just want to reset it to the original.

    /cbob

  4. #4
    Join Date
    Oct 2007
    Beans
    220
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: hostname (none)

    Seems strange that you where able to use an underscore all along. My understanding is that an underscore is an illegal character for a hostname. Is it working correctly now with the hyphen, or are you still having trouble?

    I bit of info from an ibm manual
    Avoid using the underscore (_) character in machine names. Internet standards dictate that domain names conform to the host name requirements described in Internet Official Protocol Standards RFC 952 and RFC 1123. Domain names must contain only letters (upper or lower case) and digits. Domain names can also contain dash characters ( - ) as long as the dashes are not on the ends of the name. Underscore characters ( _ ) are not supported in the host name

    Rgds
    Chris
    Last edited by chrislynch8; December 8th, 2010 at 06:25 PM.

  5. #5
    Join Date
    Dec 2009
    Location
    Sweden
    Beans
    36
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: hostname (none)

    Change to hyphen in all places where it was an underscore and it works grate! Thanks!

    Regards, cbob

Tags for this Thread

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
  •