macdnr -- Python library reference
Next: macfs
Prev: macconsole
Up: Macintosh Specific Services
Top: Top
14.5. Built-in Module macdnr
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]) -- function of module macdnr
-
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 () -- function of module macdnr
-
Close the resolver extension. Again, not needed for normal use.
- StrToAddr (hostname) -- function of module macdnr
-
Look up the IP address for hostname. This call returns a dnr
result object of the ``address'' variation.
- AddrToName (addr) -- function of module macdnr
-
Do a reverse lookup on the 32-bit integer IP-address
addr. Returns a dnr result object of the ``address'' variation.
- AddrToStr (addr) -- function of module macdnr
-
Convert the 32-bit integer IP-address addr to a dotted-decimal
string. Returns the string.
- HInfo (hostname) -- function of module macdnr
-
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) -- function of module macdnr
-
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.
Menu
- dnr result object
Next: macfs
Prev: macconsole
Up: Macintosh Specific Services
Top: Top