string PCName = Dns.GetHostEntry(Request.ServerVariables["REMOTE_ADDR"]).HostName; this is working for my laptop or pc same way i want even for mobile device
Regarding Hostname for mobile devices to access
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Naimish MakwanaRank #324 · 7.7K reputationPosted Apr 5, 2024, 3:09 AM EDT
The code you’ve provided is used to get the hostname of a device based on its IP address. This works for any device that has an IP address and a hostname, including mobile devices. However, there are a few things to keep in mind:
Privacy and Permissions: Mobile operating systems have strict privacy controls and may not allow you to access this information.
Network Address Translation (NAT): If the device is behind a router or a mobile network, the IP address you’re getting is likely the public IP address of the router or the mobile network gateway, not the device itself.
Dynamic IP: IP addresses for mobile devices can change frequently. This is especially true for devices on mobile networks.
Hostname Resolution: The ability to resolve an IP address to a hostname depends on the reverse DNS setup of the network provider, which you don’t control.
Because of these reasons, this method may not always return the expected result for mobile devices. If you’re trying to identify devices connecting to your server, consider using a method that doesn’t rely on IP addresses and hostnames, such as using unique device identifiers or user logins.
Thanks