Re: How to tell IP address of remote machine?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2009-10-26 at 16:36 +0000, Timothy Murphy wrote:
> "firefox http://whatismyipaddress.com/";
> (where I had to wait for a minute or so to get the response).

Perhaps it's overloaded?  I just tried it, and it took ages responding.
The other site, responded near instantly.

Do you have your own webspace, somewhere external from your LAN?  Does
it run Apache, or some other webserver where you can run commands, and
have the instructions for doing so?  You could run your own script to do
the same thing (tell you your IP address).  (See the end of this message
for examples.)

As to why there's different answers, there's any number of reasons.
Proxies and NAT devices between you and them, being the first things
that springs to mind.  But, in general, there's two addresses (fairly)
easily discovered from the remote end - the address of the computer that
you're browser runs on (may be a LAN address), and your external IP
address.

Things can get confusing if the thing querying names resolves IP
addresses.  It may find the IP, resolve the name, then find the IP for
the name.  There may be more than one IP associated...

An example script for Apache,
a one-line page saved as address.shtml:
<!--#echo var="REMOTE_ADDR" -->

When requested via any HTTP agent (browser, wget, etc):
wget http://example.com/address.shtml

Returns just the remote IP address, on a single line, and nothing else,
as the page.

NB:  You must be allows to run SSI (server side includes) on your
webserver.  You must write your page in a manner that the server expects
(typically, using the .shtml suffix).

The Apache manual doesn't list all of the variables that can be
returned, it only lists the extra ones it adds to the CGI environment
variables from ye olde NCSA web server.  The NCSA ones can be seen here:
http://hoohoo.ncsa.illinois.edu/cgi/env.html

-- 
[tim@localhost ~]$ uname -r
2.6.27.25-78.2.56.fc9.i686

Don't send private replies to my address, the mailbox is ignored.  I
read messages from the public lists.



-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux