Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

$ENV{'REMOTE_HOST'} is not availible in IIS.

Posted on 1997-06-25
3
Medium Priority
?
311 Views
Last Modified: 2013-12-25
When I try to get $ENV{'REMOTE_HOST'} in my Perl-script it only returns the IP-address. Why? I use Internet Information Server. Is it some kind of setting needed to enable the DNS lookup?
0
Comment
Question by:Martin
3 Comments
 
LVL 1

Expert Comment

by:ian010997
ID: 1828566
Yes, if your http server is not set up to do the logical
name lookup for you, then you will receive the IP address.
Or if it cannot give you the logical name, then it could
also give you the IP address.  I like to just use the
REMOTE_ADDR and do the lookup myself in my code when needed,
since it makes the http server faster if it doesn't have
do the lookup on the logical address for every page served.
0
 

Author Comment

by:Martin
ID: 1828567
I wanted to know how I turned this setting on!
0
 
LVL 28

Accepted Solution

by:
sybe earned 300 total points
ID: 1828568
Try this in Perl

$RemoteHost = (gethostbyaddr(inet_aton($ENV{'REMOTE_HOST'}), AF_INET))[0];

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question