You are not logged in.
Pages: 1
I followed the begineers guide on the Wiki and when I run the following command to verify my hostname, I get two different results and I don't know why...
[root@mail ~]# hostname
mail
[root@mail ~]# hostname -f
localhost.localdomain
[root@mail ~]#
I checked my /etc/hosts file and have the following:
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost mail
10.1.1.200 mail.mdg.army.mil mail
# End of file
------------------
Anyone know why I don't get my proper FQDN when I run the 'hostname -f' command?
./
Offline
Check a few working /etc/hosts out there. Also, you want hostname -a to show your hostname
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
When I run the command "localhost -a" I get the following:
[root@mail ~]# hostname -a
localhost mail
I can't find anything in the Wiki besides what it advised me to do and I did...
./
Offline
Yes, which is exactly what you have in your hosts file. Change that to whatever you want.
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
Yes, which is exactly what you have in your hosts file. Change that to whatever you want.
I guess I am confused because what you're saying or what I am gathering is conflicting with the Wiki.
Add your hostname, coinciding with the one specified in /etc/rc.conf, as an alias, so that it looks like this:
127.0.0.1 localhost.localdomain localhost [b]yourhostname[/b]
Obviously from the Wiki the bold section is to be changed accordingly to my server. Which I did so if my server is mail.iamghost.com, should I then do the following in /etc/hosts?
127.0.0.1 mail.ghost.org localhost.localdomain localhost mail
>?
./
Offline
Sorry, didn't want to be confusing. Here is my hosts file for my archtop laptop:
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain archtop
Now that _should_ make sense
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
Thanks that does make sense but I still don't understand how to append the domain to your hostname. This is going to be a mail server so its mail.iamghost.com.
I am now getting:
[root@mail ~]# hostname
mail
[root@mail ~]# hostname -a
mail
[root@mail ~]# hostname -f
localhost.localdomain
My file looks now as follows:
[root@mail ~]# cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain mail
10.1.1.200 mail.iamghost.com iamghost
# End of file
./
Offline
if you have a static ip-address, you don't put the name in 127.0.0.1 - thats only for dhcp!
Any 'server' _should_ have a static address.
So - your /etc/hosts _should_ be:
127.0.0.1 localhost
10.1.1.200 mail.iamghost.com mail
Offline
you should edit two files
first use this at your /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 <hostname> localhost.localdomain localhost
# End of file
and you have to chage in /ect/rc.conf
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="<hostname>"
Minds are like parachutes. They only function when they are open.
Offline
I had this problem, and solved it just now by reordering the names in /etc/hosts. Apparently order matters.
Before:
127.0.0.1 localhost.localdomain localhost asenath.cc.cmu.edu asenath asenath.isam.vpn.cmu.local
After:
127.0.0.1 asenath.cc.cmu.edu asenath asenath.isam.vpn.cmu.local localhost.localdomain localhost
And now it works as expected:
ataraxia@asenath:/etc $ hostname
asenath.cc.cmu.edu
ataraxia@asenath:/etc $ hostname -s
asenath
ataraxia@asenath:/etc $ hostname -f
asenath.cc.cmu.edu
Offline
As stated numerous times in this thread, the line beginning with 127.0.0.1 is the key to success
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
I beg to differ!
You use 127.0.0.1 if and only if you use dhcp.
If you have a fixed ip-address (which would seem to be the case here) then you _do_ _not_ put your hostname in 127.0.0.1 (infact - in several template hosts-file you will find a warning against it - quoting arnt gulbrandsen (redhat))
So - /etc/hosts should be
127.0.0.1 localhost
10.1.1.200 mail.iamghost.com mail
and /etc/rc.conf should have your hostname as 'mail'
Last edited by perbh (2009-09-24 00:10:21)
Offline
But 127.0.0.1 is just the loopback address. What difference does it make where you are assigned a static or dhcp address?
I mean, even if you don't assign your computer an address at all, the loopback device still exists.
Offline
perbh:
You use 127.0.0.1 if and only if you use dhcp.
This is entirely new to me - sources? Indeed, once firefox wouldn't even consider working on my box because of a missing loopback. Anyway, I think we can agree that everybody can stick their loopback where they want to
perbh:
If you have a fixed ip-address (which would seem to be the case here) then you _do_ _not_ put your hostname in 127.0.0.1
I also have a fixed ip and again, this info is new to me (just about everything appears to be new to me...) and I will try it seeing that I've got my hostname in my rc.conf already.
Thanks for the tips.
EDIT:
This may be of use: http://wiki.archlinux.org/index.php/Con … _Static_IP
Last edited by toad (2009-09-28 06:43:13)
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
Pages: 1