Results 1 to 4 of 4
How should this file look like?
At the moment it looks as follows:
Code:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
I've got a few questions regarding ...
- 08-23-2009 #1Linux Newbie
- Join Date
- Feb 2009
- Posts
- 100
/etc/hosts
How should this file look like?
At the moment it looks as follows:I've got a few questions regarding this file.Code:127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
1. Aren't there too many 'localhosts'?
2. Can I replace 127.0.0.1 with 192.168.1.100 (static IP of this box on my LAN)?
3. Also, where would I add 'revora' - the host name of this computer that I specified during the installation of Fedora?
4. What's ::1?
5. I've bought a domain name which now points to my IP address. I haven't finished a website yet, but in a few weeks time I'll start hosting my website. At the moment it's only ftp that works with that domain.
When would I want to replace localdomain with my domain name? In which situations would it be necessary/useful?
Thanks in advance
- 08-23-2009 #2It does look a little unusual, but there's no harm in it. Each name is1. Aren't there too many 'localhosts'?
just an alias for the loopback address. Ping any one of those
addresses and you ping yourself. The first line is the traditional
IPv4 style address, and the second is IPv6
Best not to, there is a subtle difference between the loopback2. Can I replace 127.0.0.1 with 192.168.1.100 (static IP of this box on my LAN)?
and the IP that is bound to an ethernet interface.
Set the 192.168.1.100 address to the host name.
192.168.1.1003. Also, where would I add 'revora' - the host name of this computer that I specified during the installation of Fedora?
That's your loopback address in IPv6 notation.4. What's ::1?
This will depend on whether you or someone else is handling DNS5. I've bought a domain name which now points to my IP address. I haven't finished a website yet, but in a few weeks time I'll start hosting my website. At the moment it's only ftp that works with that domain.
When would I want to replace localdomain with my domain name? In which situations would it be necessary/useful?
for your domain. If someone else handles it (typically whoever
sold you the domain, or maybe your own internet provider)
They would have a name server that directs your domain
traffic to your IP address (assuming you have a static address)
If you handle it yourself you would need to run a name server
and have a static address.
If you only have a dynamic address, there is a way to direct traffic to your address. It requires a service like dyndns
If external users can already reach your address by domain name,
you could go ahead and put it in to replace "localdomain"
Anyway, your /etc/hosts file doesn't affect how others connect to you, but how your machine resolves those
names in the hosts file. It is there for your use.
- 08-24-2009 #3Linux Newbie
- Join Date
- Feb 2009
- Posts
- 100
Thanks for your reply.
How would I do it?Set the 192.168.1.100 address to the host name.
in /etc/hosts?Code:192.168.1.100 revora
I use zoneedit.com for dns. So if someone types my domain name, they get directed to my router (I did some port forwarding on it). I don't have a REAL static IP, it changes once every 7-8 months so I kind of treat it as static and once I notice any change I update it on zoneedit.com. So as far as I understand your explanation, I can replace 'localhost' with my domain. Is that correct? Where would I do it? In /etc/hosts? Or anywhere else? Assuming that a LAN ip of this computer is 192.168.1.100, the box is called 'revora' and the domain name is eg. mydomain.com. How would an entry in /etc/hosts look like?This will depend on whether you or someone else is handling DNS
for your domain. If someone else handles it (typically whoever
sold you the domain, or maybe your own internet provider)
They would have a name server that directs your domain
traffic to your IP address (assuming you have a static address)
If you handle it yourself you would need to run a name server
and have a static address.
If you only have a dynamic address, there is a way to direct traffic to your address. It requires a service like dyndns
If external users can already reach your address by domain name,
you could go ahead and put it in to replace "localdomain"
Thank you
I do appreciate your help.
- 08-24-2009 #4That's correct, or you could make it revora dot your domain192.168.1.100 revora
If you want other computers on your LAN to find this one, their
hosts files will need these entries. As you said, DNS is
already set up so that people on the internet can find you.


Reply With Quote