# IPInfo Class

The IPInfo class is used to resolve host names to host addresses and vice versa using an asynchronous DNS. The class provides access to other Transmission Control Protocol (TCP)/IP database functions as well.

## Syntax

```text
ipworks.IPInfo
```

## Remarks

The IPInfo class operates asynchronously. Requests are posted to the class by setting a property like [HostName](#hostname-property-ipinfo-class) or [HostAddress](#hostaddress-property-ipinfo-class) and then waiting for the [RequestComplete](#requestcomplete-event-ipinfo-class) event. The [RequestId](#requestid-property-ipinfo-class) property identifies the request.

Up to 100 simultaneous requests can be queued at any moment. [PendingRequests](#pendingrequests-property-ipinfo-class) shows the number of pending requests and also may be used to adjust the size of the queue (by dumping a number of the pending requests).

## Property List

*The following is the full list of the properties of the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [AdapterBroadcastAddress](#adapterbroadcastaddress-property-ipinfo-class) | This property includes the broadcast address of the adapter. |
| [AdapterCount](#adaptercount-property-ipinfo-class) | This property includes the number of adapters in the system. |
| [AdapterDescription](#adapterdescription-property-ipinfo-class) | This property includes the description of the adapter identified by AdapterIndex . |
| [AdapterDeviceIndex](#adapterdeviceindex-property-ipinfo-class) | This property includes the system index of the adapter identified by AdapterIndex . |
| [AdapterDHCPEnabled](#adapterdhcpenabled-property-ipinfo-class) | This property shows whether or not the adapter identified by AdapterIndex has been DHCP enabled. |
| [AdapterDHCPServer](#adapterdhcpserver-property-ipinfo-class) | This property includes the DHCP server of the adapter identified by AdapterIndex . |
| [AdapterGateway](#adaptergateway-property-ipinfo-class) | This property includes the default gateway of the adapter identified by AdapterIndex . |
| [AdapterIndex](#adapterindex-property-ipinfo-class) | This property sets the current adapter. |
| [AdapterIPAddress](#adapteripaddress-property-ipinfo-class) | This property includes the IP address of the adapter identified by AdapterIndex . |
| [AdapterLeaseExpires](#adapterleaseexpires-property-ipinfo-class) | This property includes the expiration date and time of the lease obtained by the adapter identified by AdapterIndex . |
| [AdapterLeaseObtained](#adapterleaseobtained-property-ipinfo-class) | This property includes the date and time when the current lease was obtained by the adapter identified by AdapterIndex . |
| [AdapterName](#adaptername-property-ipinfo-class) | This property includes the name of the adapter identified by AdapterIndex . |
| [AdapterOtherIPAddresses](#adapterotheripaddresses-property-ipinfo-class) | This property includes the other IP addresses leased by the adapter specified by AdapterIndex , if any. |
| [AdapterPhysicalAddress](#adapterphysicaladdress-property-ipinfo-class) | This property includes the physical address of the adapter identified by AdapterIndex . |
| [AdapterPrimaryWINSServer](#adapterprimarywinsserver-property-ipinfo-class) | This property includes the primary WINS server of the adapter identified by AdapterIndex . |
| [AdapterSecondaryWINSServer](#adaptersecondarywinsserver-property-ipinfo-class) | This property includes the secondary WINS server of the adapter identified by AdapterIndex . |
| [AdapterStatus](#adapterstatus-property-ipinfo-class) | This property returns the current status of the adapter. |
| [AdapterSubnetMask](#adaptersubnetmask-property-ipinfo-class) | This property includes the subnet of the adapter identified by AdapterIndex . |
| [AdapterType](#adaptertype-property-ipinfo-class) | This property includes the type of adapter identified by AdapterIndex . |
| [AdapterUsesWINS](#adapteruseswins-property-ipinfo-class) | This property includes the shows whether or not the adapter identified by AdapterIndex uses WINS. |
| [ARPProxy](#arpproxy-property-ipinfo-class) | This property shows whether the local computer is acting as an Address Resolution Protocol (ARP) proxy. |
| [DHCPScope](#dhcpscope-property-ipinfo-class) | This property includes the DHCP scope of the DHCP server. |
| [DNSEnabled](#dnsenabled-property-ipinfo-class) | This property shows whether DNS is enabled on the local computer. |
| [DNSServer](#dnsserver-property-ipinfo-class) | This property includes the address of the DNS server. |
| [DomainName](#domainname-property-ipinfo-class) | This property includes the current network domain on which the system resides. |
| [HostAddress](#hostaddress-property-ipinfo-class) | This property includes an internet address in dotted format. When set, it initiates a search for the corresponding host name. |
| [HostAliases](#hostaliases-property-ipinfo-class) | This property includes other names corresponding to the host with the name HostName. |
| [HostName](#hostname-property-ipinfo-class) | This property includes the domain name of an internet host. When set, it initiates a search for the corresponding address(es). |
| [LocalHost](#localhost-property-ipinfo-class) | This property includes the name of the local host. |
| [NodeType](#nodetype-property-ipinfo-class) | This property includes the type of node for the system. |
| [OtherAddresses](#otheraddresses-property-ipinfo-class) | This property includes other addresses for the host identified by HostName (for multihomed hosts). |
| [OtherDNSServers](#otherdnsservers-property-ipinfo-class) | This property includes other DNS servers configured for the host machine. |
| [PendingRequests](#pendingrequests-property-ipinfo-class) | This property includes the number of requests awaiting completion. |
| [RequestId](#requestid-property-ipinfo-class) | This property includes the handle of the last request. |
| [RoutingEnabled](#routingenabled-property-ipinfo-class) | This property shows whether routing is enabled on the local computer. |

## Method List

*The following is the full list of the methods of the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [Config](#config-method-ipinfo-class) | Sets or retrieves a configuration setting. |
| [DHCPRelease](#dhcprelease-method-ipinfo-class) | This method releases the IP address of the current adapter specified by AdapterIndex . |
| [DHCPRenew](#dhcprenew-method-ipinfo-class) | This method renews the IP address of the current adapter specified by AdapterIndex . |
| [DisplayDNSCache](#displaydnscache-method-ipinfo-class) | This method displays cached DNS entries. |
| [DoEvents](#doevents-method-ipinfo-class) | This method processes events from the internal message queue. |
| [FlushDNSCache](#flushdnscache-method-ipinfo-class) | This method flushes the DNS cache. |
| [GetMAC](#getmac-method-ipinfo-class) | This method returns the MAC address of the network interface at IPAddress . |
| [Reset](#reset-method-ipinfo-class) | This method resets the class, stopping all pending requests and refreshing network information. |
| [ResolveAddress](#resolveaddress-method-ipinfo-class) | This method resolves an IP address. |
| [ResolveName](#resolvename-method-ipinfo-class) | This method resolves a host name. |

## Event List

*The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [DNSCacheEntry](#dnscacheentry-event-ipinfo-class) | This event fires once for each cached DNS entry. |
| [Error](#error-event-ipinfo-class) | Fired when information is available about errors during data delivery. |
| [RequestComplete](#requestcomplete-event-ipinfo-class) | This event is fired after an asynchronous request completes. |

## Config Settings

*The following is a list of config settings for the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [AdapterDADState](#AdapterDADState) | Specifies the Duplicate Address Detection state of the IP address of the adapter specified by AdapterIndex. |
| [AdapterIPv6DADState](#AdapterIPv6DADState) | Specifies the Duplicate Address Detection state of the IPv6 address of the adapter specified by AdapterIndex. |
| [AdapterOtherDADStates](#AdapterOtherDADStates) | Specifies the Duplicate Address Detection states of the IP addresses leased by the adapter specified by AdapterIndex, if any. |
| [ARPAddress](#ARPAddress) | Specifies the IP Address of the interface to be used for the GetMAC method. |
| [UseOldApi](#UseOldApi) | If set the class will use the old API to get Adapter information. |
| [BuildInfo](#BuildInfo) | Information about the product's build. |
| [GUIAvailable](#GUIAvailable) | Whether or not a message loop is available for processing events. |
| [LicenseInfo](#LicenseInfo) | Information about the current license. |
| [MaskSensitiveData](#MaskSensitiveData) | Whether sensitive data is masked in log messages. |
| [UseDaemonThreads](#UseDaemonThreads) | Whether threads created by the class are daemon threads. |
| [UseInternalSecurityAPI](#UseInternalSecurityAPI) | Whether or not to use the system security libraries or an internal implementation. |
| [UseVirtualThreads](#UseVirtualThreads) | Whether threads created by the class use virtual threads instead of platform threads. |

# AdapterBroadcastAddress Property ([IPInfo](#ipinfo-class) Class)

This property includes the broadcast address of the adapter.

## Syntax

```text
public String getAdapterBroadcastAddress();
```

## Default Value

""

## Remarks

This property contains the broadcast address of the adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class).

This property is read-only.

# AdapterCount Property ([IPInfo](#ipinfo-class) Class)

This property includes the number of adapters in the system.

## Syntax

```text
public int getAdapterCount();
```

## Default Value

0

## Remarks

This property shows how many adapters are installed in the system. You can set the [AdapterIndex](#adapterindex-property-ipinfo-class) from 0 to the AdapterCount and then examine the adapter properties, such as [AdapterDescription](#adapterdescription-property-ipinfo-class), [AdapterName](#adaptername-property-ipinfo-class), and [AdapterIPAddress](#adapteripaddress-property-ipinfo-class), to retrieve information about each adapter.

This property is read-only.

# AdapterDescription Property ([IPInfo](#ipinfo-class) Class)

This property includes the description of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterDescription();
```

## Default Value

""

## Remarks

This property contains the description of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterDeviceIndex Property ([IPInfo](#ipinfo-class) Class)

This property includes the system index of the adapter identified by AdapterIndex .

## Syntax

```text
public int getAdapterDeviceIndex();
```

## Default Value

0

## Remarks

This property contains the system index of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

This property is read-only.

# AdapterDHCPEnabled Property ([IPInfo](#ipinfo-class) Class)

This property shows whether or not the adapter identified by AdapterIndex has been DHCP enabled.

## Syntax

```text
public boolean isAdapterDHCPEnabled();
```

## Default Value

False

## Remarks

This property indicates whether or not the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class) has been DHCP enabled. The Dynamic Host Configuration Protocol (DHCP) is used to automatically assign IP addresses on a network.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterDHCPServer Property ([IPInfo](#ipinfo-class) Class)

This property includes the DHCP server of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterDHCPServer();
```

## Default Value

""

## Remarks

This property contains the DHCP server of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class). The Dynamic Host Configuration Protocol (DHCP) is used to automatically assign IP addresses on a network.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterGateway Property ([IPInfo](#ipinfo-class) Class)

This property includes the default gateway of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterGateway();
```

## Default Value

""

## Remarks

This property contains the default gateway of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterIndex Property ([IPInfo](#ipinfo-class) Class)

This property sets the current adapter.

## Syntax

```text
public int getAdapterIndex();
public void setAdapterIndex(int adapterIndex);
```

## Default Value

0

## Remarks

When this property is set, the class asks the system for information on the adapter with an index of AdapterIndex. If the system has information, the adapter properties will be populated with the data returned.

[AdapterCount](#adaptercount-property-ipinfo-class) is the number of adapters located in the system.

# AdapterIPAddress Property ([IPInfo](#ipinfo-class) Class)

This property includes the IP address of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterIPAddress();
```

## Default Value

""

## Remarks

This property contains the IP address of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

This property is read-only.

# AdapterLeaseExpires Property ([IPInfo](#ipinfo-class) Class)

This property includes the expiration date and time of the lease obtained by the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterLeaseExpires();
```

## Default Value

""

## Remarks

This property contains the expiration date and time of the lease obtained by the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterLeaseObtained Property ([IPInfo](#ipinfo-class) Class)

This property includes the date and time when the current lease was obtained by the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterLeaseObtained();
```

## Default Value

""

## Remarks

This property contains the date and time when the current lease was obtained by the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterName Property ([IPInfo](#ipinfo-class) Class)

This property includes the name of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterName();
```

## Default Value

""

## Remarks

This property contains the name of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

This property is read-only.

# AdapterOtherIPAddresses Property ([IPInfo](#ipinfo-class) Class)

This property includes the other IP addresses leased by the adapter specified by AdapterIndex , if any.

## Syntax

```text
public String getAdapterOtherIPAddresses();
```

## Default Value

""

## Remarks

This property contains a space-separated list of any other IP addresses leased by the adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class), if any.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterPhysicalAddress Property ([IPInfo](#ipinfo-class) Class)

This property includes the physical address of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterPhysicalAddress();
```

## Default Value

""

## Remarks

This property contains the physical address of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned from the system.

 NOTE: This property is not supported in MacOS or iOS.

This property is read-only.

# AdapterPrimaryWINSServer Property ([IPInfo](#ipinfo-class) Class)

This property includes the primary WINS server of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterPrimaryWINSServer();
```

## Default Value

""

## Remarks

This property contains the primary WINS server of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterSecondaryWINSServer Property ([IPInfo](#ipinfo-class) Class)

This property includes the secondary WINS server of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterSecondaryWINSServer();
```

## Default Value

""

## Remarks

This property contains the secondary WINS server of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

NOTE: This functionality is only available in Windows.

This property is read-only.

# AdapterStatus Property ([IPInfo](#ipinfo-class) Class)

This property returns the current status of the adapter.

## Syntax

```text
public String getAdapterStatus();
```

## Default Value

""

## Remarks

This property holds the current status of the adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class).

Possible values are as follows:

- "Up"
- "Down"
- "Testing"
- "Unknown"
- "Dormant"
- "NotPresent"
- "LowerLayerDown"

NOTE: This property is not applicable when [UseOldApi](#UseOldApi) is True.

This property is read-only.

# AdapterSubnetMask Property ([IPInfo](#ipinfo-class) Class)

This property includes the subnet of the adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterSubnetMask();
```

## Default Value

""

## Remarks

This property contains the subnet of the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

This property is read-only.

# AdapterType Property ([IPInfo](#ipinfo-class) Class)

This property includes the type of adapter identified by AdapterIndex .

## Syntax

```text
public String getAdapterType();
```

## Default Value

""

## Remarks

This property contains the type of adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class), as returned by the system.

Possible values include the following:

|  |  |
| --- | --- |
| OTHER | Other |
| ETHERNET | Ethernet |
| TOKENRING | Token Ring |
| FDDI | Fiber Distributed Data Interface |
| PPP | Point-to-Point Protocol |
| LOOPBACK | Loopback |
| SLIP | Serial Line Internet Protocol |

Possible values include the following (Unix OS):

|  |  |
| --- | --- |
| UP | Interface is up |
| BROADCAST | Broadcast address is valid |
| DEBUG | Turn on debugging |
| LOOPBACK | Interface is a loopback device |
| POINTOPOINT | Interface is a point-to-point link |
| RUNNING | Resources allocated |
| NOARP | No address resolution protocol |
| PROMISC | Receive all packets |
| NOTRAILERS | Avoid use of trailers |
| ALLMULTI | Receive all multicast packets |
| MASTER | Master of a load balancer |
| SLAVE | Slave of a load balancer |
| MULTICAST | Supports multicast |
| PORTSEL | Can set media type |
| AUTOMEDIA | Auto media select active |
| DYNAMIC | Dialup device with dynamic addresses |

This property is read-only.

# AdapterUsesWINS Property ([IPInfo](#ipinfo-class) Class)

This property includes the shows whether or not the adapter identified by AdapterIndex uses WINS.

## Syntax

```text
public boolean isAdapterUsesWINS();
```

## Default Value

False

## Remarks

This property indicates whether or not the adapter identified by [AdapterIndex](#adapterindex-property-ipinfo-class) uses WINS. Windows Internet Name Service (WINS) is a name resolution service that is used to resolve Windows network hostnames to IP addresses.

NOTE: This functionality is only available in Windows.

This property is read-only.

# ARPProxy Property ([IPInfo](#ipinfo-class) Class)

This property shows whether the local computer is acting as an Address Resolution Protocol (ARP) proxy.

## Syntax

```text
public boolean isARPProxy();
```

## Default Value

False

## Remarks

This property indicates whether the local computer is acting as an ARP proxy. If True, the local computer will act as an ARP proxy and will respond to ARP requests with its own hardware address.

NOTE: This functionality is only available in Windows.

This property is read-only.

# DHCPScope Property ([IPInfo](#ipinfo-class) Class)

This property includes the DHCP scope of the DHCP server.

## Syntax

```text
public String getDHCPScope();
```

## Default Value

""

## Remarks

This property contains a range of IP addresses that the Dynamic Host Configuration Protocol (DHCP) server can lease to clients.

NOTE: This functionality is only available in Windows.

This property is read-only.

# DNSEnabled Property ([IPInfo](#ipinfo-class) Class)

This property shows whether DNS is enabled on the local computer.

## Syntax

```text
public boolean isDNSEnabled();
```

## Default Value

False

## Remarks

This property indicates whether DNS is enabled on the local computer. If True, DNS is enabled, and name resolution will be available.

NOTE: This functionality is only available in Windows.

This property is read-only.

# DNSServer Property ([IPInfo](#ipinfo-class) Class)

This property includes the address of the DNS server.

## Syntax

```text
public String getDNSServer();
```

## Default Value

""

## Remarks

The class attempts to find the default DNS server for the machine where it is installed, and to provide it in this property.

If the class cannot determine the default DNS server address, this property value will be an empty string.

NOTE: This functionality is only available in Windows.

This property is read-only.

# DomainName Property ([IPInfo](#ipinfo-class) Class)

This property includes the current network domain on which the system resides.

## Syntax

```text
public String getDomainName();
```

## Default Value

""

## Remarks

This property contains the domain name to which the system is joined.

NOTE: This functionality is only available in Windows.

This property is read-only.

# HostAddress Property ([IPInfo](#ipinfo-class) Class)

This property includes an internet address in dotted format. When set, it initiates a search for the corresponding host name.

## Syntax

```text
public String getHostAddress();
public void setHostAddress(String hostAddress);
```

## Default Value

""

## Remarks

This property contains the IP address (in internet dotted format aaa.bbb.ccc.ddd) of the host whose domain name is specified by [HostName](#hostname-property-ipinfo-class)

If HostAddress is set to an IP address, a search is initiated for the corresponding host names(s).

The [RequestComplete](#requestcomplete-event-ipinfo-class) event is fired when the search is complete. The [RequestId](#requestid-property-ipinfo-class) property identifies the pending request.

**Example. Resolve an Address:**

```text
IPInfoControl.HostAddress = "10.0.1.10"
While IPInfoControl.PendingRequests > 0
    IPInfoControl.DoEvents()
End While
ResolvedName = IPInfoControl.HostName
```

# HostAliases Property ([IPInfo](#ipinfo-class) Class)

This property includes other names corresponding to the host with the name HostName.

## Syntax

```text
public String getHostAliases();
```

## Default Value

""

## Remarks

This property contains a list of alternate names for the host specified by [HostName](#hostname-property-ipinfo-class) and [HostAddress](#hostaddress-property-ipinfo-class) separated by spaces.

This property is read-only.

# HostName Property ([IPInfo](#ipinfo-class) Class)

This property includes the domain name of an internet host. When set, it initiates a search for the corresponding address(es).

## Syntax

```text
public String getHostName();
public void setHostName(String hostName);
```

## Default Value

""

## Remarks

This property contains the domain name of the host whose IP address is specified by [HostAddress](#hostaddress-property-ipinfo-class).

If this property is set to a domain name, a search is initiated for the corresponding host address(s).

The [RequestComplete](#requestcomplete-event-ipinfo-class) event is fired when the search is complete. The [RequestId](#requestid-property-ipinfo-class) property identifies the pending request.

**Example. Resolve a Name:**

```text
IPInfoControl.HostName = "MyHostName"
While IPInfoControl.PendingRequests > 0
    IPInfoControl.DoEvents()
End While
ResolvedAddress = IPInfoControl.HostAddress
```

# LocalHost Property ([IPInfo](#ipinfo-class) Class)

This property includes the name of the local host.

## Syntax

```text
public String getLocalHost();
```

## Default Value

""

## Remarks

This property contains the name of the local host as obtained by the *gethostname()* system call. If the user has assigned an IP address, it will contain the value of that address.

This property is read-only.

# NodeType Property ([IPInfo](#ipinfo-class) Class)

This property includes the type of node for the system.

## Syntax

```text
public String getNodeType();
```

## Default Value

""

## Remarks

This property contains the type of node for the system. Possible values include *BROADCAST*, *PEERTOPEER*, *MIXED*, and *HYBRID*.

NOTE: This functionality is only available in Windows.

This property is read-only.

# OtherAddresses Property ([IPInfo](#ipinfo-class) Class)

This property includes other addresses for the host identified by HostName (for multihomed hosts).

## Syntax

```text
public String getOtherAddresses();
```

## Default Value

""

## Remarks

This property contains a list of alternate addresses for the host specified by [HostName](#hostname-property-ipinfo-class) and [HostAddress](#hostaddress-property-ipinfo-class) separated by spaces. Most hosts have only one IP interface. This property is useful when querying multihomed hosts (hosts with more than one interface).

This property is read-only.

# OtherDNSServers Property ([IPInfo](#ipinfo-class) Class)

This property includes other DNS servers configured for the host machine.

## Syntax

```text
public String getOtherDNSServers();
```

## Default Value

""

## Remarks

This property contains a space-separated list of DNS servers configured for the host machine. NOTE: The primary server is provided in the [DNSServer](#dnsserver-property-ipinfo-class) property.

NOTE: This functionality is only available in Windows.

This property is read-only and not available at design time.

# PendingRequests Property ([IPInfo](#ipinfo-class) Class)

This property includes the number of requests awaiting completion.

## Syntax

```text
public int getPendingRequests();
public void setPendingRequests(int pendingRequests);
```

## Default Value

0

## Remarks

This property serves two functions: it shows the number of requests that are pending completion, and it also can be used to adjust the size of the queue by dumping part or all of the pending requests.

To cancel all the pending requests at any moment, simply set PendingRequests to 0.

NOTE: This functionality is only available in Windows.

# RequestId Property ([IPInfo](#ipinfo-class) Class)

This property includes the handle of the last request.

## Syntax

```text
public int getRequestId();
```

## Default Value

0

## Remarks

This property contains the handle of the last request.

This handle can be used later to identify the request when the [RequestComplete](#requestcomplete-event-ipinfo-class) event is fired.

NOTE: This functionality is only available in Windows.

This property is read-only.

# RoutingEnabled Property ([IPInfo](#ipinfo-class) Class)

This property shows whether routing is enabled on the local computer.

## Syntax

```text
public boolean isRoutingEnabled();
```

## Default Value

False

## Remarks

This property indicates whether routing is enabled on the local computer.

NOTE: This functionality is only available in Windows.

This property is read-only and not available at design time.

# Config Method ([IPInfo](#ipinfo-class) Class)

Sets or retrieves a configuration setting.

## Syntax

```text
public String config(String configurationString);
```

## Remarks

Config is a generic method available in every class. It is used to set and retrieve [configuration settings](#config-settings-ipinfo-class) for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these *internal properties* is provided through the Config method.

To set a configuration setting named *PROPERTY*, you must call *Config("PROPERTY=VALUE")*, where *VALUE* is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a [configuration setting](#config-settings-ipinfo-class), you must call *Config("PROPERTY")*. The value will be returned as a string.

# DHCPRelease Method ([IPInfo](#ipinfo-class) Class)

This method releases the IP address of the current adapter specified by AdapterIndex .

## Syntax

```text
public void DHCPRelease();
```

## Remarks

This method releases the IP address of the current adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class). If [AdapterDHCPEnabled](#adapterdhcpenabled-property-ipinfo-class) is True, the lease of the IP address assigned to the current adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class) is released.

NOTE: This functionality is only available in Windows.

# DHCPRenew Method ([IPInfo](#ipinfo-class) Class)

This method renews the IP address of the current adapter specified by AdapterIndex .

## Syntax

```text
public void DHCPRenew();
```

## Remarks

This method renews the IP address of the current adapter specified by AdapterIndex. If [AdapterDHCPEnabled](#adapterdhcpenabled-property-ipinfo-class) is True, the lease of the IP address assigned to the current adapter specified by [AdapterIndex](#adapterindex-property-ipinfo-class) is renewed.

NOTE: This functionality is only available in Windows.

# DisplayDNSCache Method ([IPInfo](#ipinfo-class) Class)

This method displays cached DNS entries.

## Syntax

```text
public String displayDNSCache();
```

## Remarks

This method displays details of the locally cached DNS records.

This method will return a string with information about the DNS cache. In addition the [DNSCacheEntry](#dnscacheentry-event-ipinfo-class) event will fire once per cached entry.

The returned value is in the following format:

```text
docs.google.com
----------------------------------------
Record Name . . . . . : docs.google.com
Record Type . . . . . : 1(A)
Time To Live  . . . . : 48
Data Length . . . . . : 4
Section . . . . . . . : Answer
A Record  . . . . . . : 216.58.218.238
```

NOTE: This functionality is only available in Windows.

# DoEvents Method ([IPInfo](#ipinfo-class) Class)

This method processes events from the internal message queue.

## Syntax

```text
public void doEvents();
```

## Remarks

When DoEvents is called, the class processes any available events. If no events are available, it waits for a preset period of time, and then returns.

# FlushDNSCache Method ([IPInfo](#ipinfo-class) Class)

This method flushes the DNS cache.

## Syntax

```text
public boolean flushDNSCache();
```

## Remarks

This method flushes the DNS cache for the system.

NOTE: This functionality is only available in Windows.

# GetMAC Method ([IPInfo](#ipinfo-class) Class)

This method returns the MAC address of the network interface at IPAddress .

## Syntax

```text
public String getMAC(String IPAddress);
```

## Remarks

This method returns the unique Media Access Control (MAC) address of the network interface at *IPAddress*.

NOTE: This functionality is only available in Windows.

# Reset Method ([IPInfo](#ipinfo-class) Class)

This method resets the class, stopping all pending requests and refreshing network information.

## Syntax

```text
public void reset();
```

## Remarks

This method resets the class, stopping all pending requests and refreshing network information. If the network configuration has changed, call this method to retrieve the latest information.

# ResolveAddress Method ([IPInfo](#ipinfo-class) Class)

This method resolves an IP address.

## Syntax

```text
public String resolveAddress(String hostAddress);
```

## Remarks

This method resolves the IP address *HostAddress* and sets [HostName](#hostname-property-ipinfo-class) to the name of the host corresponding to *HostAddress*.

Calling this method is equivalent to setting the [HostAddress](#hostaddress-property-ipinfo-class) property to *HostAddress*.

**Example. Resolve an Address:**

```text
String hostname = IPInfoControl.ResolveAddress("10.0.1.10");
```

# ResolveName Method ([IPInfo](#ipinfo-class) Class)

This method resolves a host name.

## Syntax

```text
public String resolveName(String hostName);
```

## Remarks

This method resolves the host name *HostName* and sets [HostAddress](#hostaddress-property-ipinfo-class) to the IP address of the host corresponding to *HostName*.

Calling this method is equivalent to setting the [HostName](#hostname-property-ipinfo-class) property to *HostName*.

**Example. Resolve a Name:**

```text
String ipaddress = IPInfoControl.ResolveName("MyHostName");
```

# DNSCacheEntry Event ([IPInfo](#ipinfo-class) Class)

This event fires once for each cached DNS entry.

## Syntax

```text
public class DefaultIPInfoEventListener implements IPInfoEventListener {
  ...
  public void DNSCacheEntry(IPInfoDNSCacheEntryEvent e) {}
  ...
}

public class IPInfoDNSCacheEntryEvent {
  public String recordName;
  public int recordType;
  public int timeToLive;
  public int dataLength;
  public String section;
  public String recordValue;
  public String recordInfo;
}
```

## Remarks

This event fires once for each entry in the local DNS cache when [DisplayDNSCache](#displaydnscache-method-ipinfo-class) is called.

*RecordName* is the host name to which the record applies.

*RecordType* is the type of response. For instance 1 is an A record.

*TimeToLive* is the time in seconds after which the cached entry expires.

*DataLength* is the length of the data in bytes. For instance, if the RecordType is A and an IPv4 address is cached, its DataLength would be 4. CNAME and PTR records will contain the length of the address in memory where the value is held.

*Section* is the section of the DNS response from which the record is taken. Most commonly, this is the "Answer" section.

*RecordValue* is the actual value that is cached. For instance this may be an IP address for A records.

*RecordInfo* is a text representation of the other parameters. This is suitable for use in a log file or to display.

# Error Event ([IPInfo](#ipinfo-class) Class)

Fired when information is available about errors during data delivery.

## Syntax

```text
public class DefaultIPInfoEventListener implements IPInfoEventListener {
  ...
  public void error(IPInfoErrorEvent e) {}
  ...
}

public class IPInfoErrorEvent {
  public int errorCode;
  public String description;
}
```

## Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the class throws an exception.

The *ErrorCode* parameter contains an error code, and the *Description* parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the [Error Codes](#trappable-errors-ipinfo-class) section.

# RequestComplete Event ([IPInfo](#ipinfo-class) Class)

This event is fired after an asynchronous request completes.

## Syntax

```text
public class DefaultIPInfoEventListener implements IPInfoEventListener {
  ...
  public void requestComplete(IPInfoRequestCompleteEvent e) {}
  ...
}

public class IPInfoRequestCompleteEvent {
  public int requestId;
  public int statusCode;
  public String description;
}
```

## Remarks

The *RequestId* parameter specifies the request that just completed. The class properties that relate to this request are completed with the returned values. For example, in the case of domain name resolution, [HostName](#hostname-property-ipinfo-class), [HostAddress](#hostaddress-property-ipinfo-class), [HostAliases](#hostaliases-property-ipinfo-class), and [OtherAddresses](#otheraddresses-property-ipinfo-class) are set to the resolved values.

If the request completed normally, *StatusCode* is 0, and *Description* is "OK". If not, *StatusCode* has the error code returned by the system. *Description* contains a description of this code.

Please refer to the [Error Codes](#trappable-errors-ipinfo-class) section for more information.

NOTE: This functionality is only available in Windows.

# Config Settings ([IPInfo](#ipinfo-class) Class)

 The class accepts one or more of the following *configuration settings*. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these *internal properties* is provided through the [Config](#config-method-ipinfo-class) method.

### IPInfo Config Settings

**AdapterDADState**: Specifies the Duplicate Address Detection state of the IP address of the adapter specified by AdapterIndex.The possible values are as follows:

- (Empty) - Indicates the class was unable to get any information.
- Invalid
- Tentative
- Duplicate
- Deprecated
- Preferred

**AdapterIPv6DADState**: Specifies the Duplicate Address Detection state of the IPv6 address of the adapter specified by AdapterIndex.The possible values are as follows:

- (Empty) - Indicates the class was unable to get any information.
- Invalid
- Tentative
- Duplicate
- Deprecated
- Preferred

**AdapterOtherDADStates**: Specifies the Duplicate Address Detection states of the IP addresses leased by the adapter specified by AdapterIndex, if any.The possible values are as follows:

- (Empty) - Indicates the class was unable to get any information.
- Invalid
- Tentative
- Duplicate
- Deprecated
- Preferred

**ARPAddress**: Specifies the IP Address of the interface to be used for the GetMAC method.By default, when [GetMAC](#getmac-method-ipinfo-class) is called, the class will attempt the address resolution from the first adapter listed by the system. In multihomed machines, it may be necessary to specify the IP address of the interface to be used as the source of the address resolution request. Set this setting to the local IP address of the adapter to be used when making this request.

**UseOldApi**: If set the class will use the old API to get Adapter information.The class uses new system calls to obtain IPv6 as well as IPv4 adapter information. Some of the new system calls, however, are not supported on the XP Windows operating system. Set this configuration setting to True, to use the old system calls when retrieving adapter information.

NOTE: This functionality is only available in Windows.

NOTE: This setting should be needed only when using the XP operating system.

### Base Config Settings

**BuildInfo**: Information about the product's build.When queried, this setting will return a string containing information about the product's build.

**GUIAvailable**: Whether or not a message loop is available for processing events.In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The class will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.

In some non-GUI applications, an invalid message loop may be discovered that will result in errant behavior. In these cases, setting [GUIAvailable](#GUIAvailable) to *false* will ensure that the class does not attempt to process external events.

**LicenseInfo**: Information about the current license.When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:

- Product: The product the license is for.
- Product Key: The key the license was generated from.
- License Source: Where the license was found (e.g., RuntimeLicense, License File).
- License Type: The type of license installed (e.g., Royalty Free, Single Server).
- Last Valid Build: The last valid build number for which the license will work.

**MaskSensitiveData**: Whether sensitive data is masked in log messages.In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to *true* to mask sensitive data. The default is *true*.

**UseDaemonThreads**: Whether threads created by the class are daemon threads.If set to True (default), when the class creates a thread, the thread's Daemon property will be explicitly set to True. When set to False, the class will not set the Daemon property on the created thread. The default value is True.

**UseInternalSecurityAPI**: Whether or not to use the system security libraries or an internal implementation. When set to *false*, the class will use the system security libraries by default to perform cryptographic functions where applicable.

Setting this configuration setting to *true* tells the class to use the internal implementation instead of using the system security libraries.

 This setting is set to *false* by default on all platforms.

**UseVirtualThreads**: Whether threads created by the class use virtual threads instead of platform threads.If set to *true*, when the class creates a thread, it will be created as a virtual thread instead of a platform thread. Virtual threads are lightweight threads managed by the JVM that are multiplexed onto a small pool of carrier threads, significantly reducing memory usage and platform thread count under high-concurrency workloads. Requires Java 24 or later. The default value is *false*.

# Trappable Errors ([IPInfo](#ipinfo-class) Class)

### IPInfo Errors

|  |  |
| --- | --- |
| 131 | Request queue is full. |
| 132 | Message for unknown request. |
| 134 | Invalid address string. |
| 310 | Adapter information is unavailable. |

### SSL Errors

|  |  |
| --- | --- |
| 270 | Cannot load specified security library. |
| 271 | Cannot open certificate store. |
| 272 | Cannot find specified certificate. |
| 273 | Cannot acquire security credentials. |
| 274 | Cannot find certificate chain. |
| 275 | Cannot verify certificate chain. |
| 276 | Error during handshake. |
| 280 | Error verifying certificate. |
| 281 | Could not find client certificate. |
| 282 | Could not find server certificate. |
| 283 | Error encrypting data. |
| 284 | Error decrypting data. |

### TCP/IP Errors

|  |  |
| --- | --- |
| 10004 | [10004] Interrupted system call. |
| 10009 | [10009] Bad file number. |
| 10013 | [10013] Access denied. |
| 10014 | [10014] Bad address. |
| 10022 | [10022] Invalid argument. |
| 10024 | [10024] Too many open files. |
| 10035 | [10035] Operation would block. |
| 10036 | [10036] Operation now in progress. |
| 10037 | [10037] Operation already in progress. |
| 10038 | [10038] Socket operation on nonsocket. |
| 10039 | [10039] Destination address required. |
| 10040 | [10040] Message is too long. |
| 10041 | [10041] Protocol wrong type for socket. |
| 10042 | [10042] Bad protocol option. |
| 10043 | [10043] Protocol is not supported. |
| 10044 | [10044] Socket type is not supported. |
| 10045 | [10045] Operation is not supported on socket. |
| 10046 | [10046] Protocol family is not supported. |
| 10047 | [10047] Address family is not supported by protocol family. |
| 10048 | [10048] Address already in use. |
| 10049 | [10049] Cannot assign requested address. |
| 10050 | [10050] Network is down. |
| 10051 | [10051] Network is unreachable. |
| 10052 | [10052] Net dropped connection or reset. |
| 10053 | [10053] Software caused connection abort. |
| 10054 | [10054] Connection reset by peer. |
| 10055 | [10055] No buffer space available. |
| 10056 | [10056] Socket is already connected. |
| 10057 | [10057] Socket is not connected. |
| 10058 | [10058] Cannot send after socket shutdown. |
| 10059 | [10059] Too many references, cannot splice. |
| 10060 | [10060] Connection timed out. |
| 10061 | [10061] Connection refused. |
| 10062 | [10062] Too many levels of symbolic links. |
| 10063 | [10063] File name is too long. |
| 10064 | [10064] Host is down. |
| 10065 | [10065] No route to host. |
| 10066 | [10066] Directory is not empty |
| 10067 | [10067] Too many processes. |
| 10068 | [10068] Too many users. |
| 10069 | [10069] Disc Quota Exceeded. |
| 10070 | [10070] Stale NFS file handle. |
| 10071 | [10071] Too many levels of remote in path. |
| 10091 | [10091] Network subsystem is unavailable. |
| 10092 | [10092] WINSOCK DLL Version out of range. |
| 10093 | [10093] Winsock is not loaded yet. |
| 11001 | [11001] Host not found. |
| 11002 | [11002] Nonauthoritative 'Host not found' (try again or check DNS setup). |
| 11003 | [11003] Nonrecoverable errors: FORMERR, REFUSED, NOTIMP. |
| 11004 | [11004] Valid name, no data record (check DNS setup). |
