K
kzavalo
Is there any way to get the fully qualified machine name?
The System.Net.Dns.GetHostByAddress method used to find the machine
name sometimes returns NetBIOS names and sometimes returns fully
qualified names. This depends on the machine.
In an attempt to always try to get a fully qualified machine name, I
have passed a machine name obtained from either
System.Net.Dns.GetHostByAddress or System.Environment.MachineName
(which might be a NetBIOS name or might be a fully qualified name) and
then pass that to System.Dns.Resolve(). This gives me a
System.Net.IPHostEntry of which I can access its HostName property. If
I start out with a NetBIOS name (which is all I have in some cases from
the other calls), sometimes I can get a fully qualified name back from
this, but sometimes I am still left with the NetBIOS name.
So, the bottom line is that there does not seem to be a sure fire way
to get the fully qualified name, does it?
Klim Zavalo.
The System.Net.Dns.GetHostByAddress method used to find the machine
name sometimes returns NetBIOS names and sometimes returns fully
qualified names. This depends on the machine.
In an attempt to always try to get a fully qualified machine name, I
have passed a machine name obtained from either
System.Net.Dns.GetHostByAddress or System.Environment.MachineName
(which might be a NetBIOS name or might be a fully qualified name) and
then pass that to System.Dns.Resolve(). This gives me a
System.Net.IPHostEntry of which I can access its HostName property. If
I start out with a NetBIOS name (which is all I have in some cases from
the other calls), sometimes I can get a fully qualified name back from
this, but sometimes I am still left with the NetBIOS name.
So, the bottom line is that there does not seem to be a sure fire way
to get the fully qualified name, does it?
Klim Zavalo.