15 DNS: Domain Name Service Queries
The net/dns library provides
utilities for looking up hostnames.
Thanks to Eduardo Cavazos and Jason Crowe for repairs and
improvements.
15.1 Functions
procedure
(dns-get-address nameserver address [ #:ipv6? ipv6?]) → string? nameserver : string? address : string? ipv6? : any/c = #f
Consults the specified nameserver (normally a numerical address like
"128.42.1.30") to obtain a numerical address for the given
Internet address.
The query record sent to the DNS server includes the "recursive" bit, but dns-get-address also implements a recursive search itself in case the server does not provide this optional feature.
If ipv6? is a true value, then the numerical address that is returned will be an IPv6 address. If no AAAA record exists, an error will be raised.
procedure
(dns-get-name nameserver address) → string?
nameserver : string? address : string?
Consults the specified nameserver (normally a numerical address like
"128.42.1.30") to obtain a name for the given numerical
address.
procedure
(dns-get-mail-exchanger nameserver address) → string?
nameserver : string? address : string?
Consults the specified nameserver to obtain the address for a mail
exchanger the given mail host address. For example, the mail exchanger
for "ollie.cs.rice.edu" might be "cs.rice.edu".
procedure
Attempts to find the address of a nameserver on the present system.
On Unix and Mac OS X, this procedure parses "/etc/resolv.conf" to
extract the first nameserver address. On Windows, it runs
nslookup.exe.
15.2 DNS Unit
dns@ and dns^ are deprecated. They exist for backward-compatibility and will likely be removed in the future. New code should use the net/dns module.
(require net/dns-unit) | package: compatibility-lib |
value
dns@ : unit?
Imports nothing, exports dns^.
15.3 DNS Signature
(require net/dns-sig) | package: compatibility-lib |
signature
dns^ : signature
Includes everything exported by the net/dns module.