You are not logged in.
Every wiki page I read and every forum post I read, I seem to find always different ways to configure the hosts file. One recommends one way and says it's the correct way, while another says different.
My hostname in /etc/rc.conf is "NAZARCH" and my current "hosts" file is this:
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 NAZARCH.localdomain NAZARCH localhost
192.168.1.100 VMHOST.localdomain VMHOST
# End of file
The "192.168.1.100" IP is the IP of my host machine (I'm running VirtualBox) and I want the hostname "VMHOST" to point to that IP.
I think I'm doing everything correctly for both entries, but would like the experts opinion.
Offline
I don't see why that wouldn't work, but try removing VMHOST.localdomain from the second line.
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
just ip host
e.g
192.168.1.100 vmhost
Give what you have. To someone, it may be better than you dare to think.
Offline
man hosts
192.168.1.100 VMHOST.localdomain VMHOST
Is the same as
192.168.1.100 VMHOST.localdomain
192.168.1.100 VMHOST
Offline
But the default file had "localhost.localdomain localhost".
What about the first line? just ip host too? like:
127.0.0.1 NAZARCH
?
Won't that make "localhost" not too work?
@rson451
I didn't said it was not working, cause it is, I was just wondering for the correct syntax.
Last edited by Nazgulled (2009-03-16 19:30:53)
Offline
If you have
127.0.0.1 localhost.localdomain localhost
127.0.0.1 google.com
Then all those three will point to 127.0.0.1 (try it out with ping)
Offline
You can define multiple names per ip. The default way you see is just a way to condense that list.
Edit: OP, I see. As stated previously, man hosts will show you what you want to know.
Last edited by rson451 (2009-03-16 19:33:37)
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
I see now what you mean.
Thank you all
Offline