Get Fully Qualified Domain Name

by Mar 25, 2013

There are two simple tricks to find out your current fully qualified domain name (FQDN).
You can either resort to ping.exe:

PS> ping -a localhost

Or, you can use .NET Framework and ask DNS:

PS> [System.Net.DNS]::GetHostByName('').HostName