Home > Software design >  VB.NET Get Local Computer Name
VB.NET Get Local Computer Name

Time:11-03

I need to retrieve the local (not server) machine name on an intranet web application. After a lot of searching, it looks like the below should work...

Dim Name As String = (Dns.GetHostEntry(Request.ServerVariables("REMOTE_HOST")).HostName)

However, this returns the error "No such host is known". Any ideas where I'm going wrong here?

Thanks

CodePudding user response:

I don't know why your statement isn't working but I use

Dim Hostname as string = System.Net.Dns.GetHostName

which you may fine useful.

CodePudding user response:

Turns out this wasn't working because we didn't have reverse lookup configured on our DNS. Since configuring this, it's now working as intended

  • Related