DNS
This section details resolving hostnames to addresses, as well as conditions/events that occur while using the DNS system.
- dns-lookup function
- dns-error condition
dns-lookup
(defun dns-lookup (host resolve-cb event-cb &key (family +af-unspec+)))
=> nil
Asynchronously lookup an IP address given a hostname. If the hostname is an IP address already, the mechanics are the same although the callback is called synchronously.
The :family
keyword can be one of +af-inet+
, +af-inet6+
, +af-unspec+
.
;; example
(dns-lookup "www.google.com"
(lambda (host family)
(format t "Address: ~a~%" host))
(lambda (err) (format t "err: ~a~%" err)))
resolve-cb definition
(lambda (ip-address-string ip-address-family) ...)
ip-address-family
will be either +af-inet+
or +af-inet6+
.
Conditions
These are the conditions the DNS system can signal in event callbacks.
dns-error
extends event-error
This explains a DNS error (for instance if a DNS lookup fails).