Java.Net.InetAddress Class
An Internet Protocol (IP) address.

See Also: InetAddress Members

Syntax

[Android.Runtime.Register("java/net/InetAddress", DoNotGenerateAcw=true)]
public class InetAddress : Java.Lang.Object, Java.IO.ISerializable, IDisposable

Remarks

An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in practice you'll have an instance of either Inet4Address or Inet6Address (this class cannot be instantiated directly). Most code does not need to distinguish between the two families, and should use InetAddress.

An InetAddress may have a hostname (accessible via getHostName), but may not, depending on how the InetAddress was created.

IPv4 numeric address formats

The getAllByName method accepts IPv4 addresses in the "decimal-dotted-quad" form only:

IPv6 numeric address formats

The getAllByName method accepts IPv6 addresses in the following forms (this text comes from , which you should consult for full details of IPv6 addressing):

Scopes are given using a trailing % followed by the scope id, as in 1080::8:800:200C:417A%2 or 1080::8:800:200C:417A%en0. See for more on IPv6's scoped address architecture.

Additionally, for backwards compatibility, IPv6 addresses may be surrounded by square brackets.

DNS caching

In Android 4.0 (Ice Cream Sandwich) and earlier, DNS caching was performed both by InetAddress and by the C library, which meant that DNS TTLs could not be honored correctly. In later releases, caching is done solely by the C library and DNS TTLs are honored.

See Also

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1