[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Localhost problem!!



ok, even i am learning, so let me go this way....

1. before even the card is "up" during a boot, configuration regarding its
ip, irq, etc. are already stored (taking the normal bootup scenario).
2. The card is then activated(with the irq etc. stored already), and also
"enabled" which means that your NIC card is now.. 192.168.1.1 or whatever ip
address it is configured for. note that these are two different things. that
is the reason that while working, you can have a card configured, but
"down".
3. now, you can give any alias or name to this ip address of yours.
4. rightly as you said, you can give more than one alias(eg. "ABC") (correct
me onthis one...) , and all will direct to the same NIC card. for the
moment, a reference on this machine , mind you from "this" machine would
lead you to this NIC card of yours...
5. other machines still cant refer to your NIC card yet, unless they too
have an "ABC", in their /etc/hosts. (or ofcourse if the DNS is working, and
has "ABC" configured....)
6. Now, all that was NIC card. not the localhost issue "yet".
7. 127.0.0.1 is the address that you refer for your """"OWN"""" machine. you
can give any name to it. but the only thing is that only your machine would
get this interface of your machine. ***so to answer your question, an ip
address or hostname, gives only "ONE" interface of your machine, NOT your
machine as a whole....***
8. from some other machine, if you need to access "this" machine's port 901
or any other.. you need to essentially call the NIC interface, NOT your
localhost alias. or else it would start pointing to its own machine instead.

moral: dont tamper localhost setup. just keep it simple and straight
127.0.0.1 localhost localhost.localdomain

moral 2: machine 1 accesses machine 2 using the NIC interface, and NOT the
localhost interface....

so machine 1 cannot use http://localhost:901 to access machine 2's 901 port,
no matter what the configuration be (ofcourse barring a few extremely odd
cases...!! )

all the best.
coz i know, lectures sometimes are quire boring..
and please guys, again, please correct wherever i was wrong...

vavi

----- Original Message -----

Hi everyone!!

i tried all three but it still doent work!!

there's one point i wish to be clear upon.
when the system boots up the Ethernet card (or the NIC) detects the IP
address assigned to it BEFORE it knows whatever hostname is assigned to
it. am i correct??
what i am trying to understand is that /etc/hosts
a) provides the machine with the corresponding IP addresses of various
hosts which may be refernced from time to time
OR
b) provides the hostname for a given IP address
OR
c) Both a & b

this is getting a bit confusing for me now.

If I change the hostname from localhost.localdomain (which has an alias
localhost) to say "ABC" while retaining the alias as "localhost" would i
still be able to reference the machine as localhost or would i need to
look for "ABC" on my N/W. This is important to me as when i try to
access the swat or http/https service running on my machine from some
other machine say "M" i cant say http://localhost:80 or
http://localhost:901 or https://localhost:443. For all i know or rather
dont know, that machine M might itself be running a web server (or even
the same web server) and then which one gets accessed??

I am sorry if i am confusing anyone but i really need a hand with this
jumbled up problem.

Thanx to evryone in advance (especially vava and yashpal)
Regds,
Puneet