Platforms to show: All Mac Windows Linux Cross-Platform

Back to DNSServiceAddrInfoMBS class.

DNSServiceAddrInfoMBS.AddrInfo(InterfaceIndex as Integer, protocol as Integer, HostName as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Network Plugin 15.0 ✅ Yes ✅ Yes ❌ No ✅ Yes All
Queries for the IP address of a hostname by using either Multicast or Unicast DNS.

interfaceIndex: The interface on which to issue the query. Passing 0 causes the query to be sent on all active interfaces via Multicast or the primary interface via Unicast.
protocol: Pass in kDNSServiceProtocol_IPv4 to look up IPv4 addresses, or kDNSServiceProtocol_IPv6 to look up IPv6 addresses, or both to look up both kinds. If neither flag is set, the system will apply an intelligent heuristic, which is (currently) that it will attempt to look up both, except:
If "hostname" is a wide-area unicast DNS hostname (i.e. not a ".local." name) but this host has no routable IPv6 address, then the call will not try to look up IPv6 addresses for "hostname", since any addresses it found would be unlikely to be of any use anyway. Similarly, if this host has no routable IPv4 address, the call will not try to look up IPv4 addresses for "hostname".

hostname: The fully qualified domain name of the host to be queried for.

Lasterror is set to kDNSServiceErr_NoError (0) on success (any subsequent, asynchronous errors are delivered to the callback), otherwise returns an error code indicating the error that occurred.

Returns false on any error and true on success. Please check lasterror property when false is returned.

Some examples using this method:

The items on this page are in the following plugins: MBS Network Plugin.


The biggest plugin in space...