Get the client's computer name

后端 未结 8 1278
轮回少年
轮回少年 2020-12-20 23:47

I am getting the client\'s (website user\'s) IP address. Now I\'d like to go one step further by knowing the user\'s computer name. So far, my research has not turned up any

相关标签:
8条回答
  • 2020-12-21 00:49

    PHP 5.4+

    gethostbyaddr($_SERVER['REMOTE_ADDR'])
    
    0 讨论(0)
  • 2020-12-21 00:50

    You can perform a reverse DNS lookup using gethostbyaddr().

    Note that this will give you the name of the host the request came from according to reverse DNS.

    • It will not give you a result if reverse DNS isn't set up
    • It will not give you the Windows name of the computer
    • It will give you the name of the router if NAT is involved or proxy if a proxy is involved.
    0 讨论(0)
提交回复
热议问题