Skip to content

Instantly share code, notes, and snippets.

@groundcat
Created January 16, 2025 08:08
Show Gist options
  • Save groundcat/b3dd887509e66ff5edaa6dd29b53a488 to your computer and use it in GitHub Desktop.
Save groundcat/b3dd887509e66ff5edaa6dd29b53a488 to your computer and use it in GitHub Desktop.
How to install and run whois command in Windows 11

How to install and run whois command in Windows 11

https://learn.microsoft.com/en-us/sysinternals/downloads/whois

In powershell:

# Create a tools directory in user's AppData folder
$toolsDir = "$env:LOCALAPPDATA\SysInternalTools"
New-Item -ItemType Directory -Path $toolsDir -Force

# Download WhoIs.zip from Microsoft
Invoke-WebRequest -Uri "https://download.sysinternals.com/files/WhoIs.zip" -OutFile "$toolsDir\WhoIs.zip"

# Extract the zip file
Expand-Archive -Path "$toolsDir\WhoIs.zip" -DestinationPath $toolsDir -Force

# Remove the zip file after extraction
Remove-Item "$toolsDir\WhoIs.zip"

# Add the tools directory to user's PATH
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($currentPath -notlike "*$toolsDir*") {
    [Environment]::SetEnvironmentVariable("Path", "$currentPath;$toolsDir", "User")
}

After running these commands:

  1. Open a new PowerShell window to get the updated PATH
  2. You can now use whois from any location

Example usage:

whois microsoft.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment