determining host name from IP address

A

amit

I have a peculiar situation. We get a lot of traffic on our
server..almost 2-3 people every second. We are getting the remote IP
address using remote_addr function but, donot get the remote host
using remote_host. It still just gives the IP address. How do i find
out the remote host name?. I am fearing if I implement a reverse look
up on my server, it will go down due to excess load as every iP will
need to be checked in the DNS for the host name. any suggestions on
how this can be done?

Amit
 
M

Michael Borgwardt

amit said:
I have a peculiar situation. We get a lot of traffic on our
server..almost 2-3 people every second.

That's very little traffic, actually, at least as far as server
resources are concerned.

We are getting the remote IP
address using remote_addr function but, donot get the remote host
using remote_host. It still just gives the IP address. How do i find
out the remote host name?. I am fearing if I implement a reverse look
up on my server, it will go down due to excess load as every iP will
need to be checked in the DNS for the host name.

Um... that's *the only* way to get the source host name, the CGI
remote_host functionality just hides it from you. It's probably disabled
in your webserver, exactly because of performance reasons. Actually,
it puts extremely little strain on the server but affects response times
negatively.

BTW, in many cases there *is no* remote host name at all, it's not required
for every IP address to have a host name assigned to it; in fact, this
is the case most of the time for end users.
 
R

Roedy Green

I am fearing if I implement a reverse look
up on my server, it will go down due to excess load as every iP will
need to be checked in the DNS for the host name. any suggestions on
how this can be done?

Either cache the results or make sure you get are reverse lookup with
big cache.
 
R

Roedy Green

it will go down due to excess load as every iP will
need to be checked in the DNS for the host name. any suggestions on
how this can be done?

Perhaps you can check this later with batch processing.
 
M

Marco Schmidt

amit:
I have a peculiar situation. We get a lot of traffic on our
server..almost 2-3 people every second. We are getting the remote IP
address using remote_addr function but, donot get the remote host
using remote_host. It still just gives the IP address. How do i find
out the remote host name?. I am fearing if I implement a reverse look
up on my server, it will go down due to excess load as every iP will
need to be checked in the DNS for the host name. any suggestions on
how this can be done?

In case you want to retrieve the geographical location of your
visitors, there are commercial services which are probably better
suited, e.g. <http://www.maxmind.com/>, <http://www.infosplit.com/>,
<http://jan.kneschke.de/projects/localizer/> (Germany / Austria /
Switzerland only). They sell databases of (IP range / country / region
/ city) records so lookups are fast because they are local.

I'm not affiliated with any of the above linked companies.

Regards,
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top