You are not logged in.
Pages: 1
I was a little confused about the /etc/hosts file on Arch Linux. I know how to set my Arch 'hostname' in rc.conf file however I get confused after reading this.
Until now I have been doing:
127.0.0.1 mypc.mydomain.tld mypc
So that has been working fine for me because when I run the 'hostname -f' command, I get my expected FQDN. I am guessing based on the Wiki, my example is wrong, no?
./
Offline
[dheart@lightbringer ~]$ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 lightbringer.localdomain lightbringer
# End of file
There're many ways to set up a working /etc/hosts so no worries there, your's just fine
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
You _must_ have 'localhost' in there as well - the following would suffice
127.0.0.1 localhost mypc
Offline
You _must_ have 'localhost' in there as well - the following would suffice
127.0.0.1 localhost mypc
If that is the case according to your example, what is your ouput if you run 'hostname -f'?
How does Arch know what your domain is?
./
Offline
What do you need a domain for?
I have never, ever, never needed a domain other than possibly in /etc/resolv.conf (in days of yore)
- but ...
I do use /etc/hosts as all my important machines have a static ip-addy - even when I use my laptop (which uses dhcp) - I never have to rely on dns to find any of my local machines, they are all there in my hostfile.
Many, many apps will use 'localhost' for their internal communication - so you must have localhost defined (eg. cups - http://localhost:631, swat - http://localhost:901). Well, you don't _have_ to - per ce - but it will save you from using the network adapter ...
Offline
If your Arch server is a mail server or any important server for that matter...applications like Postfix and MySQL require you have a domain for the FQDN.
./
Offline
Guilty as charged! I have just never had the need to use them as such - and I guess most users are 'in the same boat' (of course - I'm probably dead wrong in saying 'most' ... *lol*)
Mind you - there is no penalty for having more than 2 entries on each line in your hostfile - only ... 'localhost' _should_ be one of them eg.
127.0.0.1 mypc.mydomain mypc localhost
Last edited by perbh (2010-01-14 17:07:17)
Offline
For right now unless someone can explain the correct syntac, I am using the following for my email server:
127.0.0.1 mail.iamghost.com mail
This gives me the response I expect...
[root@mail ~]# hostname -f
mail.iamghost.com
Can someone tell me if this is dead wrong?
./
Offline
The following excerpt is from slackware-13.0 (it has been in _all_ SW's that I've ever come across) and is the 'head' of the /etc/hosts file:
#
# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
# should NEVER be named with the name of the machine. It causes problems
# for some (stupid) programs, irc and reputedly talk. :^)
#
# For loopbacking.
127.0.0.1 localhost
As far as _I_ am concerned - if you have a 'server' - it has a static ip-addy - and then you do not use the name/domain on the 'lo' i/f.
Last edited by perbh (2010-01-14 17:20:42)
Offline
I appreciate your response...but there has to be a specific format that is expected to have a FQDN or domain appended to your workstation or server. Regardless if you use DHCP or static IP, your machine should be appended to a specific domain and my question is still confusing to me.
./
Offline
I too found the hosts file advice on the wiki confusing so went with the Slackware documentation from http://www.slackbook.org/html/network-c … tcpip.html
[meyithi@158NET ~]$ cat /etc/hosts
127.0.0.1 localhost locahost.localdomain
192.168.1.64 158NET
[meyithi@158NET ~]$ hostname -f
158NET
Haven't had any problems with it as yet.
Offline
Your out put above for hostname and hostname -f are then identical. That is wrong. You have no FQDN. Any servers that run on the network like Email, Samba, MySQL, etc etc etc would fail.
I am getting the feeling many of you simply use your Arch machines on a home network or somewhere that network resources are not on a LAN level. I have several workstations and servers on a enterprise level LAN that need to be on the same domain / network.
Last edited by Carlwill (2010-01-14 20:49:24)
./
Offline
http://www.linuxquestions.org/questions … up-302189/
Edit/ Yup, I'd have to register my IP with some kind of dynamic DNS service to get a proper FQDN, but I don't need one.
Last edited by Meyithi (2010-01-14 20:56:28)
Offline
Post deleted.
Last edited by Wintervenom (2010-01-14 21:06:13)
Offline
Pages: 1