How do I find the fully qualified hostname of my machine in C#? [duplicate]

You may be able to get the whole DNS string like this:

System.Net.Dns.GetHostEntry("").HostName

We don’t have full fledged DNS names where I work, but it does give me a three level faux domain name instead of just the hostname.

Edit 2011/03/17: Incorporated changes suggested by mark below.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)