Results 1 to 10 of 11

Thread: /etc/hosts and /etc/hostname

Threaded View

  1. #1
    Join Date
    Jan 2011

    /etc/hosts and /etc/hostname

    Okay I am totally confused about this getting so many different answers from around the net. I believe this is what is giving me grief with ldap on the server. If my fqdn for my server is than how should this be set in both of these files. I am a newbie at this so be patient with me please.

    After doing some research I have changed the entries in the files to this:
    I have this currently in my /etc/hostname file

    I have this in my /etc/hosts file: elrancho

    I do not currently have a line of: localhost or or elrancho.

    I got out of the post on setting up the ldap server that, if I understand him should be elrancho. Sorry but like I said I am completely confused on this. I am alos running a dns server on the same box for resolving entries, etc.

    I also think something is not quite right since according to the docs on the hostname command "hostname" and "hostname -f" should not both return
    I will continue to work with it myself to see if I can stumble on the right combo between the two. I am still researching on understanding the relationship between the two files.

    I wonder if I should be using this in the /etc/hosts file: server1 server1

    Hmm, according to the Ubuntu manual for hostname it states:
    /etc/hostname This file should only contain the hostname and not the
    full FQDN.

    Then maybe this would be the proper setup.

    /etc/hosts: server1 server1


    Despite what the man page states - hostname with no arguments and hostname -f return the same string. I think I will change the value in /etc/hostname back to The docs I believe are confusing and seem to me to be misleading unless I am misunderstanding them.
    Last edited by ranger12; May 22nd, 2012 at 10:59 PM.


Posting Permissions

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