FQDN help

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
 
S

Sameer Goyal

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top