Name Service - SBCL 1.0.31 User Manual
Description: SBCL 1.0.31 User Manual

Previous: Local (Unix) Domain Sockets, Up: Networking

### 14.6 Name Service

Presently name service is implemented by calling out to the `getaddrinfo(3)` and `gethostinfo(3)`, or to `gethostbyname(3)` `gethostbyaddr(3)` on platforms where the preferred functions are not available. The exact details of the name resolving process (for example the choice of whether DNS or a hosts file is used for lookup) are platform dependent.

— Class: sb-bsd-sockets:host-ent

> Class precedence list: `host-ent, standard-object, t`

> Slots:

> - `name` — initarg: `:name`; reader: `sb-bsd-sockets:host-ent-name`

>   The name of the host

> - `addresses` — initarg: `:addresses`; reader: `sb-bsd-sockets:host-ent-addresses`

>   A list of addresses for this host.

> This class represents the results of an address lookup.

— Function: sb-bsd-sockets:get-host-by-name host-name

> Returns a `host-ent` instance for `host-name` or signals a `name-service-error`. `host-name` may also be an `ip` address in dotted quad notation or some other weird stuff `-` see gethostbyname(3) or getaddrinfo(3) for the details.

— Function: sb-bsd-sockets:get-host-by-address address

> Returns a `host-ent` instance for `address`, which should be a vector of (integer 0 255), or signals a `name-service-error`. See gethostbyaddr(3) or gethostinfo(3) for details.

— Generic Function: sb-bsd-sockets:host-ent-address host-ent

> Returns some valid address for `host-ent`.