# 2.4 `macdnr` -- Interface to the Macintosh Domain Name Resolver

Availability: Macintosh.

This module provides an interface to the Macintosh Domain Name Resolver. It is usually used in conjunction with the `mactcp` module, to map hostnames to IP addresses. It may not be available in all Mac Python versions.

The `macdnr` module defines the following functions:

`Open` ([filename])
  Open the domain name resolver extension. If filename is given it should be the pathname of the extension, otherwise a default is used. Normally, this call is not needed since the other calls will open the extension automatically.

`Close` ()
  Close the resolver extension. Again, not needed for normal use.

`StrToAddr` (hostname)
  Look up the IP address for hostname. This call returns a dnr result object of the ``address'' variation.

`AddrToName` (addr)
  Do a reverse lookup on the 32-bit integer IP-address addr. Returns a dnr result object of the ``address'' variation.

`AddrToStr` (addr)
  Convert the 32-bit integer IP-address addr to a dotted-decimal string. Returns the string.

`HInfo` (hostname)
  Query the nameservers for a `HInfo` record for host hostname. These records contain hardware and software information about the machine in question (if they are available in the first place). Returns a dnr result object of the ``hinfo'' variety.

`MXInfo` (domain)
  Query the nameservers for a mail exchanger for domain. This is the hostname of a host willing to accept SMTP mail for the given domain. Returns a dnr result object of the ``mx'' variety.

Subsections

- 2.4.1 DNR Result Objects