You are trying to get the domain name associated with the user's IP address?
If so you are so close here is what you need to add
Code: Select all
$userDNS = $_SERVER['REMOTE_HOST']
A couple things to keep in mind though.
1. Both 'REMOTE_ADDR' and 'REMOTE_HOST' are easily altered so I wouldn't base any security on it.
2. Most users don't access websites using their webserver so the majority of the results from REMOTE_HOST will be gibberish referring to nodes or just resolving to the IP address