FQDN help

  • Thread starter Thread starter rodchar
  • Start date Start date
R

rodchar

hey all,
can someone please tell me how to get the value of the FQDN (Fully Qualified
Domain Name) in c#?

thanks,
rodchar
 
For getting the Fully Qualified Domain Name in C# or .NET compatible language you need to use System.Net namespace.

Use Environment.UserDomainName property to get the Domain name of the network or the machine.

Declare an object of IPHostEntry Class (in system.net namespace)

IPHostEntry he = Dns.GetHostEntry(Environment.UserDomainName);

Console.WriteLine(he.HostName);

Hope it helps.
 
Back
Top