You are not logged in.
Pages: 1
What is the correct format for the /etc/hosts file ? Found in ArchWiki 2 different
here : http://wiki.archlinux.org/index.php/Configuring_network
127.0.0.1 banana.localdomain banana
& here : http://wiki.archlinux.org/index.php/LAMP
127.0.0.1 localhost.localdomain localhost banana
Both of them are correct?
Offline
yes
first comes the ip-address, then a list of names
Offline
So in the second one you have 2 names localhost & banana
and in the first you have only banana for hostname?
Thanks a lot.
Offline
You should always have localhost and localhost.localdomain - add anything else you need after those.
Offline
I experienced lag when loading webpages when I had separate entries for /etc/hosts. When I put all entries on the same line, everything works nicely. Like in the beginner's guide in the wiki:
127.0.0.1 yourhostname.domain.org localhost.localdomain localhost yourhostname
FWIW
Offline
I experienced lag when loading webpages when I had separate entries for /etc/hosts. When I put all entries on the same line, everything works nicely. Like in the beginner's guide in the wiki:
127.0.0.1 yourhostname.domain.org localhost.localdomain localhost yourhostname
FWIW
so if hostname is mm "hello"
it would be
127.0.0.1 hello.domain.org localhost.localdomain localhost hello
right? : o
Offline
i'd put something like this into the file:
127.0.0.1 localhost localhost.localdomain hostname hostname.localdomain
but i think that the localdomain stuff isn't needed at all.
Offline
i'd put something like this into the file:
127.0.0.1 localhost localhost.localdomain hostname hostname.localdomainbut i think that the localdomain stuff isn't needed at all.
Actually it is needed for program compatibility. Certain programs will lag when opening them if the localhost syntax is wrong.
Offline
Misfit138 wrote:I experienced lag when loading webpages when I had separate entries for /etc/hosts. When I put all entries on the same line, everything works nicely. Like in the beginner's guide in the wiki:
127.0.0.1 yourhostname.domain.org localhost.localdomain localhost yourhostname
FWIW
so if hostname is mm "hello"
it would be
127.0.0.1 hello.domain.org localhost.localdomain localhost hello
right? : o
Yes. I suppose YMMV, but I have had 100% success with this syntax, gleaned from the beginner's guide and forum.
Offline
These are simple questions, but I have not found the answers anywhere.
First, I can put anything I want for the hostname in rc.conf, right? That is kind of shown here in this thread, but I want to make sure, because that seems odd to me.
Next, what do I replace "localhost" and "localdomain" with? Do literally leave them typed just as your examples show?
Last, how can I tell if I have a static IP or a dynamic IP? Does it have to do with the hardware I have or my Internet provider?
Offline
You need the actual words "localhost" and "localhost.localdomain" - everything else is at the mercy of your imagination.
Offline
I made it like this:
127.0.0.1 banana.ufo.org localhost.localdomain localhost banana
10.0.0.2 banana.ufo.org banana
Offline
so what does banana resolve to now? 127.0.0.1, 10.0.0.2 or both?
Offline
I dont know man. Somewhere I saw that (if u have static ip do 2nd line with it)
What do u suggest maybe:
127.0.0.1 localhost.localdomain localhost
10.0.0.2 banana.ufo.org banana
?
Last edited by TreeMinds (2007-09-04 11:57:32)
Offline
I dont know man. Somewhere I saw that (if u have static ip do 2nd line with it)
What do u suggest maybe:
127.0.0.1 localhost.localdomain localhost
10.0.0.2 banana.ufo.org banana
?
Typically if you have a dynamic IP you would want only the 127.0.0.1 line. if you have a static IP you want to add the 2nd line. So assuming 10.0.0.2 is your static IP, this is the correct format.
Also the last entry in the file is the one that will be resolved...So for example, appending banana to the 127.0.0.1 line, when you still have the 10.0.0.2 entry effectively does nothing. banana will still resolve to 10.0.0.2
Offline
Pages: 1