Problems with hostname & hostname -f not the same

Discussion in 'Installation/Configuration' started by mcroteau105, Jun 22, 2007.

  1. mcroteau105

    mcroteau105 New Member

    I have went through the installation of Ubuntu twice now trying to get my hosts table to play nicely. But for some reason, my hostname and hostname -f are not yeilding the same values. Does anyone have any ideas on this? Thanks in advance.

    hostname yields ---> server

    hostname -f yields ---> server.example.com

    Mike
     
  2. mcroteau105

    mcroteau105 New Member

    Thank you Till

    I took this from another forum post... it worked like magic! Thanks Till :) --

    To set the hostname of your server, execute these two commands:

    echo server1.example.com > /etc/hostname

    /bin/hostname -F /etc/hostname

    "server1.example.com" must be replaced with your hostname
    __________________
    Till Brehm
    --
    http://www.projektfarm.com/en/
     
  3. Ripper

    Ripper New Member

    hostname: Unknown host

    I initially tested the hostname and hostname -f commands and discovered the results were different. Experiencing problems in other areas, I reasoned this could have an impact on those troubles. So, I followed and executed the instructions above:

    ***********
    To set the hostname of your server, execute these two commands:

    echo server1.example.com > /etc/hostname

    /bin/hostname -F /etc/hostname

    "server1.example.com" must be replaced with your hostname
    ***********

    hostname comes back correct, but hostname -f results in:

    root@ripper:/etc/bind# hostname -f
    hostname: Unknown host

    Anyone know why?

    Thanks,
    Ripper
     
    Last edited: Jun 28, 2007
  4. falko

    falko Super Moderator Howtoforge Staff

    Try to reboot the system.
     
  5. cafeelgood

    cafeelgood New Member

    I'm having the same problem, I am getting this:

    root@server:~# hostname -f
    hostname: Unknown host


    Anyone have another idea? (already tried to reboot).

    Here is my /etc/hosts

    127.0.0.1 localhost.localdomain localhost
    10.0.4.10 serveur.******.**** serveur

    # 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

     
  6. falko

    falko Super Moderator Howtoforge Staff

    Please put your desired hostname into /etc/hostname and reboot the system.
     
  7. cafeelgood

    cafeelgood New Member

    Already done with

    echo serveur.*******.info > /etc/hostname

    After verifications, everything is there, but still nothing.

    This is a clean install so i don't understant the reason of such a thing. I am using this tuto http://www.howtoforge.com/perfect_setup_ubuntu704_p3 .

    Thanks for your reply.
     
  8. cafeelgood

    cafeelgood New Member

    I will answer myself but viewing my post... i was writing serveur (which is in french) instead of server like the real name of the machine.

    I was using both idiomas, but should only use english when naming a machine... doh.

    Sorry for writing this non-problem!
     

Share This Page