Click or drag to resize

NetUtilsResolveAddress(String) Method

Resolves a host string into an IPAddress.

Namespace: LiteNetLib
Assembly: NeoAxis.Core (in NeoAxis.Core.dll) Version: 2026.2.1.0 (2026.2.1.0)
Syntax
C#
public static IPAddress ResolveAddress(
	string hostStr
)

Parameters

hostStr  String
The host name or IP address string (e.g., "127.0.0.1", "localhost", or "google.com").

Return Value

IPAddress
The resolved IPAddress.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when the address cannot be resolved or is invalid.
Remarks
This method handles "localhost" specifically, attempts to parse the string as a direct IP, and falls back to DNS resolution. It prioritizes IPv6 if IPv6Support is enabled.
See Also