[plt-scheme] Locating IPs

From: Dor Kleiman (dor at ntr.co.il)
Date: Mon Nov 3 07:34:00 EST 2003

Exactly, thanks.

-----Original Message-----
From: jensaxel at soegaard.net [mailto:jensaxel at soegaard.net]
Sent: Monday, November 03, 2003 1:32 PM
To: Dor Kleiman
Cc: plt-scheme at po.cs.brown.edu
Subject: Re: [plt-scheme] Locating IPs


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.