Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Client computer name ASP .NET

Tags:

asp.net

We are using :

System.Net.Dns.Resolve(Request.ServerVariables("remote_addr")).HostName

to get the client computer name in ASP .NET.

It works fine when run from visual studio, and even when run from IIS7, but IIS6 (or maybe some other factor) is only returning the client computer's domain name

Are there any settings or anything that would cause this function to return the domain name instead of the intended machine name?

like image 309
Jrud Avatar asked Jan 28 '26 00:01

Jrud


1 Answers

Dns.Resolve is now obsolete and so thatmight be causing the issue. Try using Dns.GetHostEntry instead and see if that fixes the issue.

like image 159
keyboardP Avatar answered Jan 30 '26 13:01

keyboardP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!