Background
Recently I needed to confirm a remote’s computer fully qualified domain name.
Options
GUI
Win OS
Outline
- Access Control Panel \ System and Security \ System
- The computer name will be listed
- Group Box:- Computer name, domain, and workgroup settings
- Item:- Full Computer Name
Images
Image – View basic information about your computer
Console
Script
Command
ipconfig
Outline
Runs commands on local and remote computers.
Syntax
ipconfig
Sample
ipconfig /all
Output – Image
Explanation
What you want to look closely at are:-
- Host Name
- Primary DNS Suffix
Powershell
Invoke-Command
Outline
Runs commands on local and remote computers.
Syntax
powershell -command "Invoke-Command -ComputerName <remoteComputer> -ScriptBlock { ([System.Net.Dns]::GetHostByName(('localhost'))).Hostname }"
Sample
powershell -command "Invoke-Command -ComputerName dbSales -ScriptBlock { ([System.Net.Dns]::GetHostByName(('localhost'))).Hostname }"
Caveat
User Fully Qualified Domain Name
The most well intentioned people get Computer Fully Qualified Domain Name and User Fully Qualified Domain Name tongue tied.
They will tell you access console and read the environment variable using “set user“.
Or more specifically, issue “set USERDNSDOMAIN“.
Microsoft specifically notes that which is returned is USERDNSDOMAIN.
And, not the computerDNSDOMAIN.
References
- Microsoft
- Powershell
- Learn / PowerShell / Scripting / Reference / Microsoft.PowerShell.Core
- Invoke-Command
Link
- Invoke-Command
- Learn / PowerShell / Scripting / Reference / Microsoft.PowerShell.Core
- Powershell