This is a Vb.NET 4.0 framework web application which is deployed over iis.
I have a welcome label on my page which will display a different message based on the what the client PC name is. The problem is that I either obtain the webserver hostname/Ip address or I receive an error "No such host is known"
Here are the different methods that have been attempted with their varying error messages.
Thanks for looking
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
'No such host is known Error
'WelcomeMessage.Text = System.Net.Dns.GetHostEntry(Request.UserHostName).ToString
'WelcomeMessage.Text = (Dns.GetHostEntry(Request.ServerVariables("remote_addr")).HostName.ToString)
'WelcomeMessage.Text = System.Net.Dns.GetHostEntry(Request.ServerVariables("REMOTE_HOST")).HostName
'I receive the IPv6 ID
'WelcomeMessage.Text = Request.UserHostAddress
'I receive the web Server ID
'WelcomeMessage.Text = System.Net.Dns.GetHostName()\
Catch ex As Exception
WelcomeMessage.Text = ex.Message
End Try
End Sub