Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$_SERVER["REMOTE_HOST"] Not sure how to setup reverse lookups 1

Status
Not open for further replies.

SPYDERIX

Technical User
Jan 11, 2002
1,899
CA
Hi,

I am trying to use:
$_SERVER["REMOTE_HOST"] to get a user's host and I know that I have to enable reverse lookups but not quite sure how I have to do that.

Can someone assist me please.

Thanks!

Nate

mainframe.gif

 
The thing about reverse DNS lookup is that it's very slow. It's also non-deterministic -- there is no guaranty that the admin of the network has set up the reverse DNS zones on his server, and with NAT and private networks, even successful reverse DNS lookups will only find the name of the user's network's firewall or router.

PHP does provide a function to perform reverse DNS lookups: gethostbyaddr() (
One recommendation I would make to inprove performance is to use a database server to record successful reverse DNS lookups, then check that table before you invoke gethostbyaddr(). This will speed lookups for your most active users immediately, and increase performance in general over time.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top