Function | Package: socket | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version

## lookup-hostname

Arguments: host &key ignore-cache ipv6 all

host should be a string naming a host, a 32-bit IP address, a string in dotted form, or an IPv6 address. This function returns the 32-bit IP address or an IPv6 address structure for the host. An error is signaled if the host can not be found. See the documentation for `*dns-mode*` for information on the manner in which name resolution occurs.

To enhance performance, lookup-hostname caches answers to queries and reuses those answers for subsequent lookups of the same name. If the IP address associated with a given hostname has changed since the information was cached, lookup-hostname may return out-of-date information.

If the ignore-cache argument is specified true, then the lookup will be done by querying the operating system libraries rather than using a value that Lisp has cached. The result of the lookup is still cached, however.

The ipv6 keyword argument was added with IPv6 support. ipv6 defaults to the value of `*ipv6*`. If `nil`, only IPv4 addresses will be returned. If `:ipv6`, then only IPv6 addresses will be returned. If `t`, then IPv6 addresses (if any) are returned in preference of IPv4 addresses. If ipv6 and all are both `t`, IPv6 addresses will be before IPv4 addresses in the returned list.

The all keyword argument was added with IPv6 support. If all is true, this function will return a list of all records.

See also `*dns-mode*`.

See socket.htm for general information on sockets in Allegro CL.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version