A number or a string.
A list of keywords.
t or the keyword
get-host-entry returns address or name information about the given host. By default, it tries to find addresses both of IPv6 and IPv4. It uses whatever host naming services are configured on the current machine.
nil is returned if the host is unknown.
The fields argument is a list of keywords describing what information to return for the host. If
get-host-entry succeeds, it returns multiple values, one value for each field specified. The following fields are allowed:
The primary IP address.
The primary IPv6 address.
The primary IPv4 address.
A list of all the IP addresses.
The primary name as a string.
The alias names as a list of strings.
IPv4 addresses are returned as integers and IPv6 addresses are returned as objects of type ipv6-address.
If ipv6 is
t the search is restricted to one family only IPv4 or IPv6. The default value of ipv6 is
:any, meaning that addresses in both families are returned. If the argument host is a string, that has a similar effect to using the family-specific keywords, but it may be faster. For example, these two calls returns the same addresses (possibly in a different order):
If host is an address of the other type, that is integer with ipv6
t or ipv6-address with ipv6
get-host-entry first tries to do a reverse lookup to find the name of the host, and then looks for the values as if it was called with this name as the host.
When avoid-reverse-lookup is non-nil,
get-host-entry avoids doing reverse lookup if host is a string which specifies a valid address (either IPv6 or IPv4). The default value of avoid-reverse-lookup is
nil, so by default it does the lookup.
When numerichost is
t, host is assumed to be a numeric address, either IPv4 if dotted notation or IPv6. If it is not,
get-host-entry just returns
nil. Using numerichost can speed up
get-host-entry, because it prevents any DNS lookup. This has an effect only if avoid-reverse-lookup is non-nil. The default value of numerichost is
get-host-entryare not cached by LispWorks, the Operating System might cache them.
get-host-entryis passed a string specifying an IPv6 address, the address can be followed by '%' character and a scope ID. If the scope ID is a decimal number or a valid interface name on the local system, the resulting address contains the scope ID as a number.
LispWorks User Guide and Reference Manual - 13 Feb 2015