[plt-scheme] Locating IPs

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Nov 3 06:32:08 EST 2003

Here is the doc from the net collection.

Does dns-get-name do what you want?

/Jens Axel



==========================================================================
_DNS_, _domain name service_
==========================================================================

To load directly: (require (lib "dns.ss" "net"))
Module files: _dns.ss_ - provides the procedures documented below
               _dns-unit.ss_ - provides unit net:dns@
               _dns-sig.ss_ - provides signalture net:dns^

ABSTRACT -------------------------------------------------------------

Implements part of a DNS client, based on RFC 1035. The name cache
does not properly time out entries, however.

Thanks to Eduardo Cavazos and Jason Crowe for repairs and
improvements.

PROCEDURES -----------------------------------------------------------

 > (dns-get-address nameserver-string address-string) -> address-string

   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.

 > (dns-get-name nameserver-string address-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.

 > (dns-get-mail-exchanger nameserver-string address-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" is currently "cs.rice.edu".

 > (dns-find-nameserver) -> address-string or #f

   Attempts to find the address of a nameserver on the present system.
   Under Unix, this procedure parses /etc/resolv.conf to extract the
   first nameserver address.



Posted on the users mailing list.