$ENV{'REMOTE_HOST'} Problem on NT 
Author Message
 $ENV{'REMOTE_HOST'} Problem on NT

Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
with an IP address instead of user123.blah.com or whatever?

I'm running the perl script on a Windows NT IIS 4.0 server with the latest
service pack 4 plus the latest built perl from Active State.

Help me please.

Thanks,

Bill

*NOTE: When replying, remove "nospam." from the return email address.



Fri, 25 May 2001 03:00:00 GMT  
 $ENV{'REMOTE_HOST'} Problem on NT

Quote:

> Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> with an IP address instead of user123.blah.com or whatever?

This is provided by the webserver, so you're at it's mercy.  If the
webserver is configured to return resolved hostnames, that's what you
get.  If name resolution isn't available (or enabled) then you will get
IP addresses.

Bryan
--
------------------------------------------------------------
|  Bryan Hart                 |  Phone: (515) 296-5979     |
|  Network Products Engineer  |  Fax: (515) 296-7025       |

|                             |  WWW: http://www.eai.com/
|                        
------------------------------------------------------------



Fri, 25 May 2001 03:00:00 GMT  
 $ENV{'REMOTE_HOST'} Problem on NT

Quote:
> Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> with an IP address instead of user123.blah.com or whatever?

> I'm running the perl script on a Windows NT IIS 4.0 server with the latest
> service pack 4 plus the latest built perl from Active State.

This is the way the IIS <ahem> works - you need to be asking in a group such
as comp.infosystems.www.servers.ms-windows.

/J\
--

Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>



Fri, 25 May 2001 03:00:00 GMT  
 $ENV{'REMOTE_HOST'} Problem on NT


Quote:

> > Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
> > with an IP address instead of user123.blah.com or whatever?

> This is provided by the webserver, so you're at it's mercy.  If the
> webserver is configured to return resolved hostnames, that's what you
> get.  If name resolution isn't available (or enabled) then you will get
> IP addresses.

If name resolution isn't available (which is very unlikely!), there is
nothing you can do.  But if it isn't enabled (which is very likely!),
you can do it yourself, rather easily.

There are several resources:  the docs in Socket.pm, the gethostbyaddr()
function, and, for example, Recipe 17.7 in The Perl Cookbook,
"Identifying the Other End of a Socket".

--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/



Fri, 25 May 2001 03:00:00 GMT  
 $ENV{'REMOTE_HOST'} Problem on NT

Quote:

>Does anybody know why, when I run $ENV{'REMOTE_HOST'}, do I always come up
>with an IP address instead of user123.blah.com or whatever?

because that's what you're supposed to get.  it impacts server performance
for the webserver to do name lookups on every hit, so most servers are not
configured to do that.  if you want the name you have to do the dns lookup
yourself.  now, how to do that on NT i'll have to leave for someone else...

-dave



Sun, 10 Jun 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Removing first token of $ENV{'REMOTE_HOST'}

2. NT Perl5 $Env('PATH]) Problem

3. 'REMOTE_HOST'

4. ENV{'REMOTE_USER'} problem

5. Problem: With the $ENV{'blah'} variable

6. Why can't I set env variable in Perl (NT)

7. %ENV doesn't work with PerlIS on NT S

8. ENV{'REMOTE_HOST'}; .... does not work ?!

9. ENV{'REMOTE_HOST'} doesnt work, solution?

10. $ENV{'AUTH_TYPE'} and $ENV{'REMOTE_USER'}

11. Problems with env: can't use -w or -T

12. $ENV{'QUERY_STRING"} problem

 

 
Powered by phpBB® Forum Software