home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / pytexdoc / ext / lib / lib2 / macdnr / tex
LaTeX Document  |  1996-11-08  |  3.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0a 5c 73 65 63 74 69 6f | 6e 7b 42 75 69 6c 74 2d |.\sectio|n{Built-|
|00000010| 69 6e 20 4d 6f 64 75 6c | 65 20 5c 73 65 63 74 63 |in Modul|e \sectc|
|00000020| 6f 64 65 7b 6d 61 63 64 | 6e 72 7d 7d 0a 5c 62 69 |ode{macd|nr}}.\bi|
|00000030| 6d 6f 64 69 6e 64 65 78 | 7b 6d 61 63 64 6e 72 7d |modindex|{macdnr}|
|00000040| 0a 0a 54 68 69 73 20 6d | 6f 64 75 6c 65 20 70 72 |..This m|odule pr|
|00000050| 6f 76 69 64 65 73 20 61 | 6e 20 69 6e 74 65 72 66 |ovides a|n interf|
|00000060| 61 63 65 20 74 6f 20 74 | 68 65 20 4d 61 63 69 6e |ace to t|he Macin|
|00000070| 74 6f 73 68 20 44 6f 6d | 61 69 6e 20 4e 61 6d 65 |tosh Dom|ain Name|
|00000080| 0a 52 65 73 6f 6c 76 65 | 72 2e 20 20 49 74 20 69 |.Resolve|r. It i|
|00000090| 73 20 75 73 75 61 6c 6c | 79 20 75 73 65 64 20 69 |s usuall|y used i|
|000000a0| 6e 20 63 6f 6e 6a 75 6e | 63 74 69 6f 6e 20 77 69 |n conjun|ction wi|
|000000b0| 74 68 20 74 68 65 20 5c | 76 61 72 7b 6d 61 63 74 |th the \|var{mact|
|000000c0| 63 70 7d 0a 6d 6f 64 75 | 6c 65 2c 20 74 6f 20 6d |cp}.modu|le, to m|
|000000d0| 61 70 20 68 6f 73 74 6e | 61 6d 65 73 20 74 6f 20 |ap hostn|ames to |
|000000e0| 49 50 2d 61 64 64 72 65 | 73 73 65 73 2e 20 20 49 |IP-addre|sses. I|
|000000f0| 74 20 6d 61 79 20 6e 6f | 74 20 62 65 20 61 76 61 |t may no|t be ava|
|00000100| 69 6c 61 62 6c 65 20 69 | 6e 0a 61 6c 6c 20 4d 61 |ilable i|n.all Ma|
|00000110| 63 20 50 79 74 68 6f 6e | 20 76 65 72 73 69 6f 6e |c Python| version|
|00000120| 73 2e 0a 0a 54 68 65 20 | 5c 63 6f 64 65 7b 6d 61 |s...The |\code{ma|
|00000130| 63 64 6e 72 7d 20 6d 6f | 64 75 6c 65 20 64 65 66 |cdnr} mo|dule def|
|00000140| 69 6e 65 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ines the| followi|
|00000150| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 3a 0a 0a 5c |ng funct|ions:..\|
|00000160| 72 65 6e 65 77 63 6f 6d | 6d 61 6e 64 7b 5c 69 6e |renewcom|mand{\in|
|00000170| 64 65 78 73 75 62 69 74 | 65 6d 7d 7b 28 69 6e 20 |dexsubit|em}{(in |
|00000180| 6d 6f 64 75 6c 65 20 6d | 61 63 64 6e 72 29 7d 0a |module m|acdnr)}.|
|00000190| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|000001a0| 7d 7b 4f 70 65 6e 7d 7b | 5c 6f 70 74 69 6f 6e 61 |}{Open}{|\optiona|
|000001b0| 6c 7b 66 69 6c 65 6e 61 | 6d 65 7d 7d 0a 4f 70 65 |l{filena|me}}.Ope|
|000001c0| 6e 20 74 68 65 20 64 6f | 6d 61 69 6e 20 6e 61 6d |n the do|main nam|
|000001d0| 65 20 72 65 73 6f 6c 76 | 65 72 20 65 78 74 65 6e |e resolv|er exten|
|000001e0| 73 69 6f 6e 2e 20 20 49 | 66 20 5c 76 61 72 7b 66 |sion. I|f \var{f|
|000001f0| 69 6c 65 6e 61 6d 65 7d | 20 69 73 20 67 69 76 65 |ilename}| is give|
|00000200| 6e 20 69 74 0a 73 68 6f | 75 6c 64 20 62 65 20 74 |n it.sho|uld be t|
|00000210| 68 65 20 70 61 74 68 6e | 61 6d 65 20 6f 66 20 74 |he pathn|ame of t|
|00000220| 68 65 20 65 78 74 65 6e | 73 69 6f 6e 2c 20 6f 74 |he exten|sion, ot|
|00000230| 68 65 72 77 69 73 65 20 | 61 20 64 65 66 61 75 6c |herwise |a defaul|
|00000240| 74 20 69 73 0a 75 73 65 | 64 2e 20 20 4e 6f 72 6d |t is.use|d. Norm|
|00000250| 61 6c 6c 79 2c 20 74 68 | 69 73 20 63 61 6c 6c 20 |ally, th|is call |
|00000260| 69 73 20 6e 6f 74 20 6e | 65 65 64 65 64 20 73 69 |is not n|eeded si|
|00000270| 6e 63 65 20 74 68 65 20 | 6f 74 68 65 72 20 63 61 |nce the |other ca|
|00000280| 6c 6c 73 20 77 69 6c 6c | 0a 6f 70 65 6e 20 74 68 |lls will|.open th|
|00000290| 65 20 65 78 74 65 6e 73 | 69 6f 6e 20 61 75 74 6f |e extens|ion auto|
|000002a0| 6d 61 74 69 63 61 6c 6c | 79 2e 0a 5c 65 6e 64 7b |maticall|y..\end{|
|000002b0| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|000002c0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 43 6c 6f 73 |n{funcde|sc}{Clos|
|000002d0| 65 7d 7b 7d 0a 43 6c 6f | 73 65 20 74 68 65 20 72 |e}{}.Clo|se the r|
|000002e0| 65 73 6f 6c 76 65 72 20 | 65 78 74 65 6e 73 69 6f |esolver |extensio|
|000002f0| 6e 2e 20 20 41 67 61 69 | 6e 2c 20 6e 6f 74 20 6e |n. Agai|n, not n|
|00000300| 65 65 64 65 64 20 66 6f | 72 20 6e 6f 72 6d 61 6c |eeded fo|r normal|
|00000310| 20 75 73 65 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 | use..\e|nd{funcd|
|00000320| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000330| 63 64 65 73 63 7d 7b 53 | 74 72 54 6f 41 64 64 72 |cdesc}{S|trToAddr|
|00000340| 7d 7b 68 6f 73 74 6e 61 | 6d 65 7d 0a 4c 6f 6f 6b |}{hostna|me}.Look|
|00000350| 20 75 70 20 74 68 65 20 | 49 50 20 61 64 64 72 65 | up the |IP addre|
|00000360| 73 73 20 66 6f 72 20 5c | 76 61 72 7b 68 6f 73 74 |ss for \|var{host|
|00000370| 6e 61 6d 65 7d 2e 20 20 | 54 68 69 73 20 63 61 6c |name}. |This cal|
|00000380| 6c 20 72 65 74 75 72 6e | 73 20 61 20 64 6e 72 0a |l return|s a dnr.|
|00000390| 72 65 73 75 6c 74 20 6f | 62 6a 65 63 74 20 6f 66 |result o|bject of|
|000003a0| 20 74 68 65 20 60 60 61 | 64 64 72 65 73 73 27 27 | the ``a|ddress''|
|000003b0| 20 76 61 72 69 61 74 69 | 6f 6e 2e 0a 5c 65 6e 64 | variati|on..\end|
|000003c0| 7b 66 75 6e 63 64 65 73 | 63 7d 0a 0a 5c 62 65 67 |{funcdes|c}..\beg|
|000003d0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 41 64 64 |in{funcd|esc}{Add|
|000003e0| 72 54 6f 4e 61 6d 65 7d | 7b 61 64 64 72 7d 0a 44 |rToName}|{addr}.D|
|000003f0| 6f 20 61 20 72 65 76 65 | 72 73 65 20 6c 6f 6f 6b |o a reve|rse look|
|00000400| 75 70 20 6f 6e 20 74 68 | 65 20 33 32 2d 62 69 74 |up on th|e 32-bit|
|00000410| 20 69 6e 74 65 67 65 72 | 20 49 50 2d 61 64 64 72 | integer| IP-addr|
|00000420| 65 73 73 0a 5c 76 61 72 | 7b 61 64 64 72 7d 2e 20 |ess.\var|{addr}. |
|00000430| 20 52 65 74 75 72 6e 73 | 20 61 20 64 6e 72 20 72 | Returns| a dnr r|
|00000440| 65 73 75 6c 74 20 6f 62 | 6a 65 63 74 20 6f 66 20 |esult ob|ject of |
|00000450| 74 68 65 20 60 60 61 64 | 64 72 65 73 73 27 27 20 |the ``ad|dress'' |
|00000460| 76 61 72 69 61 74 69 6f | 6e 2e 0a 5c 65 6e 64 7b |variatio|n..\end{|
|00000470| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000480| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 41 64 64 72 |n{funcde|sc}{Addr|
|00000490| 54 6f 53 74 72 7d 7b 61 | 64 64 72 7d 0a 43 6f 6e |ToStr}{a|ddr}.Con|
|000004a0| 76 65 72 74 20 74 68 65 | 20 33 32 2d 62 69 74 20 |vert the| 32-bit |
|000004b0| 69 6e 74 65 67 65 72 20 | 49 50 2d 61 64 64 72 65 |integer |IP-addre|
|000004c0| 73 73 20 5c 76 61 72 7b | 61 64 64 72 7d 20 74 6f |ss \var{|addr} to|
|000004d0| 20 61 20 64 6f 74 74 65 | 64 2d 64 65 63 69 6d 61 | a dotte|d-decima|
|000004e0| 6c 0a 73 74 72 69 6e 67 | 2e 20 20 52 65 74 75 72 |l.string|. Retur|
|000004f0| 6e 73 20 74 68 65 20 73 | 74 72 69 6e 67 2e 0a 5c |ns the s|tring..\|
|00000500| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|00000510| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000520| 48 49 6e 66 6f 7d 7b 68 | 6f 73 74 6e 61 6d 65 7d |HInfo}{h|ostname}|
|00000530| 0a 51 75 65 72 79 20 74 | 68 65 20 6e 61 6d 65 73 |.Query t|he names|
|00000540| 65 72 76 65 72 73 20 66 | 6f 72 20 61 20 5c 63 6f |ervers f|or a \co|
|00000550| 64 65 7b 48 49 6e 66 6f | 7d 20 72 65 63 6f 72 64 |de{HInfo|} record|
|00000560| 20 66 6f 72 20 68 6f 73 | 74 0a 5c 76 61 72 7b 68 | for hos|t.\var{h|
|00000570| 6f 73 74 6e 61 6d 65 7d | 2e 20 20 54 68 65 73 65 |ostname}|. These|
|00000580| 20 72 65 63 6f 72 64 73 | 20 63 6f 6e 74 61 69 6e | records| contain|
|00000590| 20 68 61 72 64 77 61 72 | 65 20 61 6e 64 20 73 6f | hardwar|e and so|
|000005a0| 66 74 77 61 72 65 0a 69 | 6e 66 6f 72 6d 61 74 69 |ftware.i|nformati|
|000005b0| 6f 6e 20 61 62 6f 75 74 | 20 74 68 65 20 6d 61 63 |on about| the mac|
|000005c0| 68 69 6e 65 20 69 6e 20 | 71 75 65 73 74 69 6f 6e |hine in |question|
|000005d0| 20 28 69 66 20 74 68 65 | 79 20 61 72 65 20 61 76 | (if the|y are av|
|000005e0| 61 69 6c 61 62 6c 65 20 | 69 6e 0a 74 68 65 20 66 |ailable |in.the f|
|000005f0| 69 72 73 74 20 70 6c 61 | 63 65 29 2e 20 20 52 65 |irst pla|ce). Re|
|00000600| 74 75 72 6e 73 20 61 20 | 64 6e 72 20 72 65 73 75 |turns a |dnr resu|
|00000610| 6c 74 20 6f 62 6a 65 63 | 74 20 6f 66 20 74 68 65 |lt objec|t of the|
|00000620| 20 60 60 68 69 6e 66 6f | 27 27 0a 76 61 72 69 65 | ``hinfo|''.varie|
|00000630| 74 79 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ty..\end|{funcdes|
|00000640| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000650| 65 73 63 7d 7b 4d 58 49 | 6e 66 6f 7d 7b 64 6f 6d |esc}{MXI|nfo}{dom|
|00000660| 61 69 6e 7d 0a 51 75 65 | 72 79 20 74 68 65 20 6e |ain}.Que|ry the n|
|00000670| 61 6d 65 73 65 72 76 65 | 72 73 20 66 6f 72 20 61 |ameserve|rs for a|
|00000680| 20 6d 61 69 6c 20 65 78 | 63 68 61 6e 67 65 72 20 | mail ex|changer |
|00000690| 66 6f 72 20 5c 76 61 72 | 7b 64 6f 6d 61 69 6e 7d |for \var|{domain}|
|000006a0| 2e 20 20 54 68 69 73 20 | 69 73 0a 74 68 65 20 68 |. This |is.the h|
|000006b0| 6f 73 74 6e 61 6d 65 20 | 6f 66 20 61 20 68 6f 73 |ostname |of a hos|
|000006c0| 74 20 77 69 6c 6c 69 6e | 67 20 74 6f 20 61 63 63 |t willin|g to acc|
|000006d0| 65 70 74 20 53 4d 54 50 | 20 6d 61 69 6c 20 66 6f |ept SMTP| mail fo|
|000006e0| 72 20 74 68 65 20 67 69 | 76 65 6e 0a 64 6f 6d 61 |r the gi|ven.doma|
|000006f0| 69 6e 2e 20 20 52 65 74 | 75 72 6e 73 20 61 20 64 |in. Ret|urns a d|
|00000700| 6e 72 20 72 65 73 75 6c | 74 20 6f 62 6a 65 63 74 |nr resul|t object|
|00000710| 20 6f 66 20 74 68 65 20 | 60 60 6d 78 27 27 20 76 | of the |``mx'' v|
|00000720| 61 72 69 65 74 79 2e 0a | 5c 65 6e 64 7b 66 75 6e |ariety..|\end{fun|
|00000730| 63 64 65 73 63 7d 0a 0a | 5c 73 75 62 73 65 63 74 |cdesc}..|\subsect|
|00000740| 69 6f 6e 7b 64 6e 72 20 | 72 65 73 75 6c 74 20 6f |ion{dnr |result o|
|00000750| 62 6a 65 63 74 7d 0a 0a | 53 69 6e 63 65 20 74 68 |bject}..|Since th|
|00000760| 65 20 44 4e 52 20 63 61 | 6c 6c 73 20 61 6c 6c 20 |e DNR ca|lls all |
|00000770| 65 78 65 63 75 74 65 20 | 61 73 79 6e 63 68 72 6f |execute |asynchro|
|00000780| 6e 6f 75 73 6c 79 20 79 | 6f 75 20 64 6f 20 6e 6f |nously y|ou do no|
|00000790| 74 20 67 65 74 20 74 68 | 65 0a 72 65 73 75 6c 74 |t get th|e.result|
|000007a0| 73 20 62 61 63 6b 20 69 | 6d 6d 65 64 69 61 74 65 |s back i|mmediate|
|000007b0| 6c 79 2e 20 20 49 6e 73 | 74 65 61 64 2c 20 79 6f |ly. Ins|tead, yo|
|000007c0| 75 20 67 65 74 20 61 20 | 64 6e 72 20 72 65 73 75 |u get a |dnr resu|
|000007d0| 6c 74 20 6f 62 6a 65 63 | 74 2e 20 20 59 6f 75 0a |lt objec|t. You.|
|000007e0| 63 61 6e 20 63 68 65 63 | 6b 20 74 68 69 73 20 6f |can chec|k this o|
|000007f0| 62 6a 65 63 74 20 74 6f | 20 73 65 65 20 77 68 65 |bject to| see whe|
|00000800| 74 68 65 72 20 74 68 65 | 20 71 75 65 72 79 20 69 |ther the| query i|
|00000810| 73 20 63 6f 6d 70 6c 65 | 74 65 2c 20 61 6e 64 20 |s comple|te, and |
|00000820| 61 63 63 65 73 73 0a 69 | 74 73 20 61 74 74 72 69 |access.i|ts attri|
|00000830| 62 75 74 65 73 20 74 6f | 20 6f 62 74 61 69 6e 20 |butes to| obtain |
|00000840| 74 68 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |the info|rmation |
|00000850| 77 68 65 6e 20 69 74 20 | 69 73 2e 0a 0a 41 6c 74 |when it |is...Alt|
|00000860| 65 72 6e 61 74 69 76 65 | 6c 79 2c 20 79 6f 75 20 |ernative|ly, you |
|00000870| 63 61 6e 20 61 6c 73 6f | 20 72 65 66 65 72 65 6e |can also| referen|
|00000880| 63 65 20 74 68 65 20 72 | 65 73 75 6c 74 20 61 74 |ce the r|esult at|
|00000890| 74 72 69 62 75 74 65 73 | 20 64 69 72 65 63 74 6c |tributes| directl|
|000008a0| 79 2c 0a 74 68 69 73 20 | 77 69 6c 6c 20 72 65 73 |y,.this |will res|
|000008b0| 75 6c 74 20 69 6e 20 61 | 6e 20 69 6d 70 6c 69 63 |ult in a|n implic|
|000008c0| 69 74 20 77 61 69 74 20 | 66 6f 72 20 74 68 65 20 |it wait |for the |
|000008d0| 71 75 65 72 79 20 74 6f | 20 63 6f 6d 70 6c 65 74 |query to| complet|
|000008e0| 65 2e 0a 0a 54 68 65 20 | 5c 76 61 72 7b 72 74 6e |e...The |\var{rtn|
|000008f0| 43 6f 64 65 7d 20 61 6e | 64 20 5c 76 61 72 7b 63 |Code} an|d \var{c|
|00000900| 6e 61 6d 65 7d 20 61 74 | 74 72 69 62 75 74 65 73 |name} at|tributes|
|00000910| 20 61 72 65 20 61 6c 77 | 61 79 73 20 61 76 61 69 | are alw|ays avai|
|00000920| 6c 61 62 6c 65 2c 20 74 | 68 65 0a 6f 74 68 65 72 |lable, t|he.other|
|00000930| 73 20 64 65 70 65 6e 64 | 20 6f 6e 20 74 68 65 20 |s depend| on the |
|00000940| 74 79 70 65 20 6f 66 20 | 71 75 65 72 79 20 28 61 |type of |query (a|
|00000950| 64 64 72 65 73 73 2c 20 | 68 69 6e 66 6f 20 6f 72 |ddress, |hinfo or|
|00000960| 20 6d 78 29 2e 0a 0a 5c | 72 65 6e 65 77 63 6f 6d | mx)...\|renewcom|
|00000970| 6d 61 6e 64 7b 5c 69 6e | 64 65 78 73 75 62 69 74 |mand{\in|dexsubit|
|00000980| 65 6d 7d 7b 28 64 6e 72 | 20 72 65 73 75 6c 74 20 |em}{(dnr| result |
|00000990| 6f 62 6a 65 63 74 20 6d | 65 74 68 6f 64 29 7d 0a |object m|ethod)}.|
|000009a0| 0a 25 20 41 64 64 20 61 | 72 67 73 2c 20 61 73 20 |.% Add a|rgs, as |
|000009b0| 69 6e 20 7b 61 72 67 31 | 5c 2c 20 61 72 67 32 20 |in {arg1|\, arg2 |
|000009c0| 5c 6f 70 74 69 6f 6e 61 | 6c 7b 5c 2c 20 61 72 67 |\optiona|l{\, arg|
|000009d0| 33 7d 7d 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |3}}.\beg|in{funcd|
|000009e0| 65 73 63 7d 7b 77 61 69 | 74 7d 7b 7d 0a 57 61 69 |esc}{wai|t}{}.Wai|
|000009f0| 74 20 66 6f 72 20 74 68 | 65 20 71 75 65 72 79 20 |t for th|e query |
|00000a00| 74 6f 20 63 6f 6d 70 6c | 65 74 65 2e 0a 5c 65 6e |to compl|ete..\en|
|00000a10| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0a 0a 25 20 41 |d{funcde|sc}..% A|
|00000a20| 64 64 20 61 72 67 73 2c | 20 61 73 20 69 6e 20 7b |dd args,| as in {|
|00000a30| 61 72 67 31 5c 2c 20 61 | 72 67 32 20 5c 6f 70 74 |arg1\, a|rg2 \opt|
|00000a40| 69 6f 6e 61 6c 7b 5c 2c | 20 61 72 67 33 7d 7d 0a |ional{\,| arg3}}.|
|00000a50| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000a60| 7b 69 73 64 6f 6e 65 7d | 7b 7d 0a 52 65 74 75 72 |{isdone}|{}.Retur|
|00000a70| 6e 20 31 20 69 66 20 74 | 68 65 20 71 75 65 72 79 |n 1 if t|he query|
|00000a80| 20 69 73 20 63 6f 6d 70 | 6c 65 74 65 2e 0a 5c 65 | is comp|lete..\e|
|00000a90| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 72 |nd{funcd|esc}..\r|
|00000aa0| 65 6e 65 77 63 6f 6d 6d | 61 6e 64 7b 5c 69 6e 64 |enewcomm|and{\ind|
|00000ab0| 65 78 73 75 62 69 74 65 | 6d 7d 7b 28 64 6e 72 20 |exsubite|m}{(dnr |
|00000ac0| 72 65 73 75 6c 74 20 6f | 62 6a 65 63 74 20 61 74 |result o|bject at|
|00000ad0| 74 72 69 62 75 74 65 29 | 7d 0a 0a 5c 62 65 67 69 |tribute)|}..\begi|
|00000ae0| 6e 7b 64 61 74 61 64 65 | 73 63 7d 7b 72 74 6e 43 |n{datade|sc}{rtnC|
|00000af0| 6f 64 65 7d 0a 54 68 65 | 20 65 72 72 6f 72 20 63 |ode}.The| error c|
|00000b00| 6f 64 65 20 72 65 74 75 | 72 6e 65 64 20 62 79 20 |ode retu|rned by |
|00000b10| 74 68 65 20 71 75 65 72 | 79 2e 0a 5c 65 6e 64 7b |the quer|y..\end{|
|00000b20| 64 61 74 61 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |datadesc|}..\begi|
|00000b30| 6e 7b 64 61 74 61 64 65 | 73 63 7d 7b 63 6e 61 6d |n{datade|sc}{cnam|
|00000b40| 65 7d 0a 54 68 65 20 63 | 61 6e 6f 6e 69 63 61 6c |e}.The c|anonical|
|00000b50| 20 6e 61 6d 65 20 6f 66 | 20 74 68 65 20 68 6f 73 | name of| the hos|
|00000b60| 74 20 74 68 61 74 20 77 | 61 73 20 71 75 65 72 69 |t that w|as queri|
|00000b70| 65 64 2e 0a 5c 65 6e 64 | 7b 64 61 74 61 64 65 73 |ed..\end|{datades|
|00000b80| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 64 61 74 61 64 |c}..\beg|in{datad|
|00000b90| 65 73 63 7d 7b 69 70 30 | 7d 0a 5c 64 61 74 61 6c |esc}{ip0|}.\datal|
|00000ba0| 69 6e 65 7b 69 70 31 7d | 0a 5c 64 61 74 61 6c 69 |ine{ip1}|.\datali|
|00000bb0| 6e 65 7b 69 70 32 7d 0a | 5c 64 61 74 61 6c 69 6e |ne{ip2}.|\datalin|
|00000bc0| 65 7b 69 70 33 7d 0a 41 | 74 20 6d 6f 73 74 20 66 |e{ip3}.A|t most f|
|00000bd0| 6f 75 72 20 69 6e 74 65 | 67 65 72 20 49 50 20 61 |our inte|ger IP a|
|00000be0| 64 64 72 65 73 73 65 73 | 20 66 6f 72 20 74 68 69 |ddresses| for thi|
|00000bf0| 73 20 68 6f 73 74 2e 20 | 20 55 6e 75 73 65 64 20 |s host. | Unused |
|00000c00| 65 6e 74 72 69 65 73 20 | 61 72 65 0a 7a 65 72 6f |entries |are.zero|
|00000c10| 2e 20 20 56 61 6c 69 64 | 20 6f 6e 6c 79 20 66 6f |. Valid| only fo|
|00000c20| 72 20 61 64 64 72 65 73 | 73 20 71 75 65 72 69 65 |r addres|s querie|
|00000c30| 73 2e 0a 5c 65 6e 64 7b | 64 61 74 61 64 65 73 63 |s..\end{|datadesc|
|00000c40| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 64 61 74 61 64 65 |}..\begi|n{datade|
|00000c50| 73 63 7d 7b 63 70 75 54 | 79 70 65 7d 0a 5c 64 61 |sc}{cpuT|ype}.\da|
|00000c60| 74 61 6c 69 6e 65 7b 6f | 73 54 79 70 65 7d 0a 54 |taline{o|sType}.T|
|00000c70| 65 78 74 75 61 6c 20 73 | 74 72 69 6e 67 73 20 67 |extual s|trings g|
|00000c80| 69 76 69 6e 67 20 74 68 | 65 20 6d 61 63 68 69 6e |iving th|e machin|
|00000c90| 65 20 74 79 70 65 20 61 | 6e 20 4f 53 20 6e 61 6d |e type a|n OS nam|
|00000ca0| 65 2e 20 20 56 61 6c 69 | 64 20 66 6f 72 20 68 69 |e. Vali|d for hi|
|00000cb0| 6e 66 6f 0a 71 75 65 72 | 69 65 73 2e 0a 5c 65 6e |nfo.quer|ies..\en|
|00000cc0| 64 7b 64 61 74 61 64 65 | 73 63 7d 0a 0a 5c 62 65 |d{datade|sc}..\be|
|00000cd0| 67 69 6e 7b 64 61 74 61 | 64 65 73 63 7d 7b 65 78 |gin{data|desc}{ex|
|00000ce0| 63 68 61 6e 67 65 7d 0a | 54 68 65 20 6e 61 6d 65 |change}.|The name|
|00000cf0| 20 6f 66 20 61 20 6d 61 | 69 6c 2d 65 78 63 68 61 | of a ma|il-excha|
|00000d00| 6e 67 65 72 20 68 6f 73 | 74 2e 20 20 56 61 6c 69 |nger hos|t. Vali|
|00000d10| 64 20 66 6f 72 20 6d 78 | 20 71 75 65 72 69 65 73 |d for mx| queries|
|00000d20| 2e 0a 5c 65 6e 64 7b 64 | 61 74 61 64 65 73 63 7d |..\end{d|atadesc}|
|00000d30| 0a 0a 5c 62 65 67 69 6e | 7b 64 61 74 61 64 65 73 |..\begin|{datades|
|00000d40| 63 7d 7b 70 72 65 66 65 | 72 65 6e 63 65 7d 0a 54 |c}{prefe|rence}.T|
|00000d50| 68 65 20 70 72 65 66 65 | 72 65 6e 63 65 20 6f 66 |he prefe|rence of|
|00000d60| 20 74 68 69 73 20 6d 78 | 20 72 65 63 6f 72 64 2e | this mx| record.|
|00000d70| 20 20 4e 6f 74 20 74 6f | 6f 20 75 73 65 66 75 6c | Not to|o useful|
|00000d80| 2c 20 73 69 6e 63 65 20 | 74 68 65 20 4d 61 63 69 |, since |the Maci|
|00000d90| 6e 74 6f 73 68 0a 77 69 | 6c 6c 20 6f 6e 6c 79 20 |ntosh.wi|ll only |
|00000da0| 72 65 74 75 72 6e 20 61 | 20 73 69 6e 67 6c 65 20 |return a| single |
|00000db0| 6d 78 20 72 65 63 6f 72 | 64 2e 20 20 4d 78 20 71 |mx recor|d. Mx q|
|00000dc0| 75 65 72 69 65 73 20 6f | 6e 6c 79 2e 0a 5c 65 6e |ueries o|nly..\en|
|00000dd0| 64 7b 64 61 74 61 64 65 | 73 63 7d 0a 0a 54 68 65 |d{datade|sc}..The|
|00000de0| 20 73 69 6d 70 6c 65 73 | 74 20 77 61 79 20 74 6f | simples|t way to|
|00000df0| 20 75 73 65 20 74 68 65 | 20 6d 6f 64 75 6c 65 20 | use the| module |
|00000e00| 74 6f 20 63 6f 6e 76 65 | 72 74 20 6e 61 6d 65 73 |to conve|rt names|
|00000e10| 20 74 6f 20 64 6f 74 74 | 65 64 2d 64 65 63 69 6d | to dott|ed-decim|
|00000e20| 61 6c 0a 73 74 72 69 6e | 67 73 2c 20 77 69 74 68 |al.strin|gs, with|
|00000e30| 6f 75 74 20 77 6f 72 72 | 79 69 6e 67 20 61 62 6f |out worr|ying abo|
|00000e40| 75 74 20 69 64 6c 65 20 | 74 69 6d 65 2c 20 65 74 |ut idle |time, et|
|00000e50| 63 3a 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |c:.\begi|n{verbat|
|00000e60| 69 6d 7d 0a 3e 3e 3e 20 | 64 65 66 20 67 65 74 68 |im}.>>> |def geth|
|00000e70| 6f 73 74 6e 61 6d 65 28 | 6e 61 6d 65 29 3a 0a 2e |ostname(|name):..|
|00000e80| 2e 2e 20 20 20 20 20 69 | 6d 70 6f 72 74 20 6d 61 |.. i|mport ma|
|00000e90| 63 64 6e 72 0a 2e 2e 2e | 20 20 20 20 20 64 6e 72 |cdnr....| dnr|
|00000ea0| 72 20 3d 20 6d 61 63 64 | 6e 72 2e 53 74 72 54 6f |r = macd|nr.StrTo|
|00000eb0| 41 64 64 72 28 6e 61 6d | 65 29 0a 2e 2e 2e 20 20 |Addr(nam|e).... |
|00000ec0| 20 20 20 72 65 74 75 72 | 6e 20 6d 61 63 64 6e 72 | retur|n macdnr|
|00000ed0| 2e 41 64 64 72 54 6f 53 | 74 72 28 64 6e 72 72 2e |.AddrToS|tr(dnrr.|
|00000ee0| 69 70 30 29 0a 5c 65 6e | 64 7b 76 65 72 62 61 74 |ip0).\en|d{verbat|
|00000ef0| 69 6d 7d 0a | |im}. | |
+--------+-------------------------+-------------------------+--------+--------+