-
Notifications
You must be signed in to change notification settings - Fork 1
Resolve‑DnsName
Resolve a DNS host name (or dotted IP string) to a single IPv4 address.
Resolve-DnsName [-HostName] <String> [<CommonParameters>]
Uses the cross-platform .NET System.Net.Dns class to resolve DNS names to IPv4 addresses, providing compatibility across Windows, macOS, and Linux platforms even when the built-in Resolve-DnsName cmdlet is not available. If the input is already a valid IPv4 address, it will be returned as-is.
Resolve-DnsName 'pc.company.local'
192.168.1.42
This example resolves the host name 'pc.company.local' to its IPv4 address.
Resolve-DnsName '192.168.1.42'
192.168.1.42
This example demonstrates that if the input is already a valid IPv4 address, it is returned without modification.
Resolve-DnsName 'google.com'
142.250.191.14
This example resolves the public domain 'google.com' to one of its IPv4 addresses.
Specifies the DNS host name to resolve or an IPv4 address literal. The parameter accepts both fully qualified domain names (FQDN) and simple host names. IPv4 addresses are validated and returned without resolution.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
This function uses the .NET System.Net.Dns.GetHostAddresses method which provides cross-platform DNS resolution capabilities. Only IPv4 addresses are returned; IPv6 addresses are filtered out.
- Assert-GitLocalChange
- Assert-GitRemote
- Assert-IPv4Address
- Clear-AnsiSequence
- ConvertTo-AnsiSequence
- ConvertTo-AnsiString
- ConvertTo-DifferenceString
- ConvertTo-RelativePath
- Disable-CursorShortcutCode
- Get-ClassAst
- Get-ClassResourceAst
- Get-GitBranchCommit
- Get-GitLocalBranchName
- Get-GitRemote
- Get-GitRemoteBranch
- Get-GitTag
- Get-LinkLayerAddress
- Get-ModuleByVersion
- Get-ModuleFileSha
- Get-ModuleVersion
- Get-NumericalSequence
- Get-PSReadLineHistory
- Get-TextOffset
- Install-ModulePatch
- Invoke-Git
- Invoke-PesterJob
- New-GitTag
- New-SamplerGitHubReleaseTag
- Out-Difference
- Pop-VMLatestSnapshot
- Push-GitTag
- Receive-GitBranch
- Remove-GitTag
- Remove-History
- Remove-PSHistory
- Remove-PSReadLineHistory
- Rename-GitLocalBranch
- Rename-GitRemote
- Request-GitTag
- Resolve-DnsName
- Resume-GitRebase
- Send-WakeOnLan
- Split-StringAtIndex
- Start-GitRebase
- Stop-GitRebase
- Switch-GitLocalBranch
- Test-FileHash
- Test-GitLocalChanges
- Test-GitRemote
- Test-GitRemoteBranch
- Test-IPv4Address
- Update-GitLocalBranch
- Update-RemoteTrackingBranch