Home » Personal collection » Acorn hard disk » apps » web » InetDB/Resolver
InetDB/Resolver
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn hard disk » apps » web |
Filename: | InetDB/Resolver |
Read OK: | ✔ |
File size: | 217D bytes |
Load address: | 0000 |
Exec address: | 0000 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- Personal collection » Acorn ADFS disks » Greaseweazled » adfs_1.6M_NetBits.adf » InetDB/Resolver
- Personal collection » Acorn hard disk » apps » web » InetDB/Resolver
File contents
INetDB - Cacheing Resolver -------------------------- Copyright (c) 1994 Adam Goodfellow This software is in part based upon source that is Copyright (c) 1985, 1988 Regents of the University of California. All rights reserved. [NOTE: The InetDB module itself is no longer required by ArcWeb. However, the configuration files used by ArcWeb are the same as those required by InetDB, thus the instructions are the same] Introduction ============ The basic Acorn and FreeNet TCP/IP stacks allows names of hosts with which you want to communicate to be kept in a local file to save you having to remember the numeric IP address for each host. For small networks this is generally quite acceptable. However, for larger networks and especially the Internet, keeping the hosts file upto date can be very time consuming, if not impossible. To get round this problem, it is normal for one or more machines on a network to provide host name and IP address databases that are accessable on a single machine. In actual fact, with very large networks, this database (Domain Name System or DNS) is distributed amongst a number of machines (called name-servers), each being responsible for pursuing information about other networks (domains) on behalf of hosts on its local network (in its local domain), and answering secific queries about its local network (domain) from systems on other networks (in other domains). The Resolver provided as part of the INetDB module performs the task of communicating with nameservers on behalf of many applications written for the FreeNet and/or Acorn TCP/IP stacks. Normally, as the name-server is a machine connected to your local network, the time taken to get a reply from a nameserver is quite short, a fraction of a second on a lightly loaded network and a lightly loaded name-server. However with heavily loaded networks and nameservers, or if the query has to be sent over serial connection via a modem to a nameserver on the Internet, the time taken for the response can be quite long, especially with the recent upsurge in Internet use. Also, in circumstances of heavy network conjestion, additional queries caused by resending of requests that have been deemed lost further degrades network performance. The obvious solution is to somehow reduce the dependancy upon the name-server for processing queries every time you make a connection to another named host. This what sets this resolver apart from the types of resolver commonly found on desktop computers. It remembers information recently obtained from a name-server in a cache and so is often able to give an instant responce to a repeat of recent similar query, making it very appropriate for use where the nameserver is at the other end of a dial up connection via a modem. The cacheing methods used are such that so long as the name-servers are providing accurate information about the life time of data retrieved, then the cache will only give upto date information, and will automatically remove information considered out of date, ensuring a fresh copy is read from the nameserver. Setting Up ========== Resolver configuration is stored in the file "!FreeUser.Files.ResConf". Options in this file are as follows: (See example) nameserver ---------- nameserver <ip_address> Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3) name servers may be listed, one per keyword. If there are multiple servers, the resolver library queries them in the order listed. If no nameserver entries are present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made). domain ------ Local domain name. Most queries for names within this domain can use short names relative to the local domain. If no domain entry is present, the domain is determined from the local host name returned by gethostname() the domain part is taken to be everything after the first '.'. Finally, if the host name does not contain a domain part, the root domain is assumed. search ------ Search list for host-name lookup. The search list is normally determined from the local domain name; by default, it begins with the local domain name, then successive parent domains that have at least two components in their names. This may be changed by listing the desired domain search path following the \fIsearch\fP keyword with spaces or tabs separating the names. Most resolver queries will be attempted using each component of the search path in turn until a match is found. Note that this process may be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if no server is available for one of the domains. The search list is currently limited to six domains with a total of 256 characters. sortlist -------- Sortlist allows addresses returned by gethostbyname to be sorted. A sortlist is specified by IP address netmask pairs. The netmask is optional and defaults to the natural netmask of the net. The IP address and optional network pairs are seperated by slashes. Up to 10 pairs may be specified. e.g. sortlist 130.155.160.0/255.255.240.0 130.155.0.0 options ------- Options allows certain internal resolver variables to be modified. The syntax is options <option> ... where <option> is one of the following: debug sets RES_DEBUG in _res.options. ndots sets a threshold for the number of dots which must appear in a name given to res_query (see resolver) before an initial absolute query will be made. The default for n is 1, meaning that if there are any dots in a name, the name will be tried first as an absolute name before any search list elements are appended to it. cachesize --------- Enables the RR cache. Values may be given as <n> bytes, or <n>k kbytes. Size less than 1024 are rounded upto 1024. cacheload --------- Read RRs from one or more file into the cache. If you are saving the cache at shutdown, then one of thes files should be the cache file. for eg: cacheload resboot rescache cachesave --------- This sets where the cache is saved to at shutdown. retry ----- This sets the number of retries attempted to each nameserver (default 4) timeout ------- This sets the min and max timeouts between retrying the same nameserver again. After each retry, the timeout is doubled upto the max value. Nameserver retries are dstributed through the timeout period, so if the timeout period is 6 seconds, and 3 nameservers have be specified, the next nameserver is tried 2 seconds after the first. ---- The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins. The search keyword of a system's resolv.conf file can be overridden on a per-process basis by setting the environment variable LOCALDOMAIN to a space-separated list of search domains. The options keyword of a system's resolv.conf file can be amended on a per-process basis by setting the environment variable RES_OPTIONS to a space-separated list of resolver options as explained above under options. The keyword and value must appear on a single line, and the keyword (e.g. nameserver) must start the line. The value follows the keyword, separated by white space. Programmer Interface ==================== This file is incomplete, there are also a few *commands, some of which are implemented. The SWI Interface is as follows: SWI Internet_GetHostByName &46000 On entry: R0 = 0 R1 = -> host name On exit: R1 = pointer to hostent structure or NULL if not found SWI Internet_GetHostByAddr &46001 On entry: R0 = 0 R1 = -> host addr R2 = len of addr R3 = type of addr On exit: R1 = pointer to hostent structure, or NULL if not found Where the hostent stucture is defined as below. Note that all addresses are given in net byte order (the reverse of the normal Acorn byte order). struct hostent { char *h_name; /* Official name of host */ char **h_aliases; /* Alternative names for host */ int h_addrtype; /* Host address type */ int h_length; /* Length of each address */ char **h_addr_list; /* List of addresses for host */ #define h_addr h_addr_list[0] /* Address, for back compatability */ };
00000000 49 4e 65 74 44 42 20 2d 20 43 61 63 68 65 69 6e |INetDB - Cachein| 00000010 67 20 52 65 73 6f 6c 76 65 72 0a 2d 2d 2d 2d 2d |g Resolver.-----| 00000020 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d |----------------| 00000030 2d 2d 2d 2d 2d 0a 0a 20 20 20 43 6f 70 79 72 69 |-----.. Copyri| 00000040 67 68 74 20 28 63 29 20 31 39 39 34 20 41 64 61 |ght (c) 1994 Ada| 00000050 6d 20 47 6f 6f 64 66 65 6c 6c 6f 77 0a 0a 54 68 |m Goodfellow..Th| 00000060 69 73 20 73 6f 66 74 77 61 72 65 20 69 73 20 69 |is software is i| 00000070 6e 20 70 61 72 74 20 62 61 73 65 64 20 75 70 6f |n part based upo| 00000080 6e 20 73 6f 75 72 63 65 20 74 68 61 74 20 69 73 |n source that is| 00000090 20 0a 20 0a 20 20 20 43 6f 70 79 72 69 67 68 74 | . . Copyright| 000000a0 20 28 63 29 20 31 39 38 35 2c 20 31 39 38 38 20 | (c) 1985, 1988 | 000000b0 52 65 67 65 6e 74 73 20 6f 66 20 74 68 65 20 55 |Regents of the U| 000000c0 6e 69 76 65 72 73 69 74 79 20 6f 66 20 43 61 6c |niversity of Cal| 000000d0 69 66 6f 72 6e 69 61 2e 0a 20 20 20 41 6c 6c 20 |ifornia.. All | 000000e0 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 2e |rights reserved.| 000000f0 0a 0a 0a 5b 4e 4f 54 45 3a 20 20 54 68 65 20 49 |...[NOTE: The I| 00000100 6e 65 74 44 42 20 6d 6f 64 75 6c 65 20 69 74 73 |netDB module its| 00000110 65 6c 66 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 |elf is no longer| 00000120 20 72 65 71 75 69 72 65 64 20 62 79 20 41 72 63 | required by Arc| 00000130 57 65 62 2e 20 20 48 6f 77 65 76 65 72 2c 0a 74 |Web. However,.t| 00000140 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e |he configuration| 00000150 20 66 69 6c 65 73 20 75 73 65 64 20 62 79 20 41 | files used by A| 00000160 72 63 57 65 62 20 61 72 65 20 74 68 65 20 73 61 |rcWeb are the sa| 00000170 6d 65 20 61 73 20 74 68 6f 73 65 20 72 65 71 75 |me as those requ| 00000180 69 72 65 64 20 62 79 0a 49 6e 65 74 44 42 2c 20 |ired by.InetDB, | 00000190 74 68 75 73 20 74 68 65 20 69 6e 73 74 72 75 63 |thus the instruc| 000001a0 74 69 6f 6e 73 20 61 72 65 20 74 68 65 20 73 61 |tions are the sa| 000001b0 6d 65 5d 0a 0a 49 6e 74 72 6f 64 75 63 74 69 6f |me]..Introductio| 000001c0 6e 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a |n.============..| 000001d0 54 68 65 20 62 61 73 69 63 20 41 63 6f 72 6e 20 |The basic Acorn | 000001e0 61 6e 64 20 46 72 65 65 4e 65 74 20 54 43 50 2f |and FreeNet TCP/| 000001f0 49 50 20 73 74 61 63 6b 73 20 61 6c 6c 6f 77 73 |IP stacks allows| 00000200 20 6e 61 6d 65 73 20 6f 66 20 68 6f 73 74 73 20 | names of hosts | 00000210 77 69 74 68 20 77 68 69 63 68 0a 79 6f 75 20 77 |with which.you w| 00000220 61 6e 74 20 74 6f 20 63 6f 6d 6d 75 6e 69 63 61 |ant to communica| 00000230 74 65 20 74 6f 20 62 65 20 6b 65 70 74 20 69 6e |te to be kept in| 00000240 20 61 20 6c 6f 63 61 6c 20 66 69 6c 65 20 74 6f | a local file to| 00000250 20 73 61 76 65 20 79 6f 75 20 68 61 76 69 6e 67 | save you having| 00000260 20 74 6f 0a 72 65 6d 65 6d 62 65 72 20 74 68 65 | to.remember the| 00000270 20 6e 75 6d 65 72 69 63 20 49 50 20 61 64 64 72 | numeric IP addr| 00000280 65 73 73 20 66 6f 72 20 65 61 63 68 20 68 6f 73 |ess for each hos| 00000290 74 2e 20 46 6f 72 20 73 6d 61 6c 6c 20 6e 65 74 |t. For small net| 000002a0 77 6f 72 6b 73 20 74 68 69 73 20 69 73 0a 67 65 |works this is.ge| 000002b0 6e 65 72 61 6c 6c 79 20 71 75 69 74 65 20 61 63 |nerally quite ac| 000002c0 63 65 70 74 61 62 6c 65 2e 0a 0a 48 6f 77 65 76 |ceptable...Howev| 000002d0 65 72 2c 20 66 6f 72 20 6c 61 72 67 65 72 20 6e |er, for larger n| 000002e0 65 74 77 6f 72 6b 73 20 61 6e 64 20 65 73 70 65 |etworks and espe| 000002f0 63 69 61 6c 6c 79 20 74 68 65 20 49 6e 74 65 72 |cially the Inter| 00000300 6e 65 74 2c 20 6b 65 65 70 69 6e 67 20 74 68 65 |net, keeping the| 00000310 0a 68 6f 73 74 73 20 66 69 6c 65 20 75 70 74 6f |.hosts file upto| 00000320 20 64 61 74 65 20 63 61 6e 20 62 65 20 76 65 72 | date can be ver| 00000330 79 20 74 69 6d 65 20 63 6f 6e 73 75 6d 69 6e 67 |y time consuming| 00000340 2c 20 69 66 20 6e 6f 74 20 69 6d 70 6f 73 73 69 |, if not impossi| 00000350 62 6c 65 2e 0a 0a 54 6f 20 67 65 74 20 72 6f 75 |ble...To get rou| 00000360 6e 64 20 74 68 69 73 20 70 72 6f 62 6c 65 6d 2c |nd this problem,| 00000370 20 69 74 20 69 73 20 6e 6f 72 6d 61 6c 20 66 6f | it is normal fo| 00000380 72 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 6d 61 |r one or more ma| 00000390 63 68 69 6e 65 73 20 6f 6e 20 61 0a 6e 65 74 77 |chines on a.netw| 000003a0 6f 72 6b 20 74 6f 20 70 72 6f 76 69 64 65 20 68 |ork to provide h| 000003b0 6f 73 74 20 6e 61 6d 65 20 61 6e 64 20 49 50 20 |ost name and IP | 000003c0 61 64 64 72 65 73 73 20 64 61 74 61 62 61 73 65 |address database| 000003d0 73 20 74 68 61 74 20 61 72 65 0a 61 63 63 65 73 |s that are.acces| 000003e0 73 61 62 6c 65 20 6f 6e 20 61 20 73 69 6e 67 6c |sable on a singl| 000003f0 65 20 6d 61 63 68 69 6e 65 2e 0a 0a 49 6e 20 61 |e machine...In a| 00000400 63 74 75 61 6c 20 66 61 63 74 2c 20 77 69 74 68 |ctual fact, with| 00000410 20 76 65 72 79 20 6c 61 72 67 65 20 6e 65 74 77 | very large netw| 00000420 6f 72 6b 73 2c 20 74 68 69 73 20 64 61 74 61 62 |orks, this datab| 00000430 61 73 65 20 28 44 6f 6d 61 69 6e 20 4e 61 6d 65 |ase (Domain Name| 00000440 0a 53 79 73 74 65 6d 20 6f 72 20 44 4e 53 29 20 |.System or DNS) | 00000450 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 61 |is distributed a| 00000460 6d 6f 6e 67 73 74 20 61 20 6e 75 6d 62 65 72 20 |mongst a number | 00000470 6f 66 20 6d 61 63 68 69 6e 65 73 20 28 63 61 6c |of machines (cal| 00000480 6c 65 64 0a 6e 61 6d 65 2d 73 65 72 76 65 72 73 |led.name-servers| 00000490 29 2c 20 65 61 63 68 20 62 65 69 6e 67 20 72 65 |), each being re| 000004a0 73 70 6f 6e 73 69 62 6c 65 20 66 6f 72 20 70 75 |sponsible for pu| 000004b0 72 73 75 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 |rsuing informati| 000004c0 6f 6e 20 61 62 6f 75 74 0a 6f 74 68 65 72 20 6e |on about.other n| 000004d0 65 74 77 6f 72 6b 73 20 28 64 6f 6d 61 69 6e 73 |etworks (domains| 000004e0 29 20 6f 6e 20 62 65 68 61 6c 66 20 6f 66 20 68 |) on behalf of h| 000004f0 6f 73 74 73 20 6f 6e 20 69 74 73 20 6c 6f 63 61 |osts on its loca| 00000500 6c 20 6e 65 74 77 6f 72 6b 20 28 69 6e 20 69 74 |l network (in it| 00000510 73 0a 6c 6f 63 61 6c 20 64 6f 6d 61 69 6e 29 2c |s.local domain),| 00000520 20 61 6e 64 20 61 6e 73 77 65 72 69 6e 67 20 73 | and answering s| 00000530 65 63 69 66 69 63 20 71 75 65 72 69 65 73 20 61 |ecific queries a| 00000540 62 6f 75 74 20 69 74 73 20 6c 6f 63 61 6c 20 6e |bout its local n| 00000550 65 74 77 6f 72 6b 0a 28 64 6f 6d 61 69 6e 29 20 |etwork.(domain) | 00000560 66 72 6f 6d 20 73 79 73 74 65 6d 73 20 6f 6e 20 |from systems on | 00000570 6f 74 68 65 72 20 6e 65 74 77 6f 72 6b 73 20 28 |other networks (| 00000580 69 6e 20 6f 74 68 65 72 20 64 6f 6d 61 69 6e 73 |in other domains| 00000590 29 2e 0a 0a 54 68 65 20 52 65 73 6f 6c 76 65 72 |)...The Resolver| 000005a0 20 70 72 6f 76 69 64 65 64 20 61 73 20 70 61 72 | provided as par| 000005b0 74 20 6f 66 20 74 68 65 20 49 4e 65 74 44 42 20 |t of the INetDB | 000005c0 6d 6f 64 75 6c 65 20 70 65 72 66 6f 72 6d 73 20 |module performs | 000005d0 74 68 65 20 74 61 73 6b 20 6f 66 0a 63 6f 6d 6d |the task of.comm| 000005e0 75 6e 69 63 61 74 69 6e 67 20 77 69 74 68 20 6e |unicating with n| 000005f0 61 6d 65 73 65 72 76 65 72 73 20 6f 6e 20 62 65 |ameservers on be| 00000600 68 61 6c 66 20 6f 66 20 6d 61 6e 79 20 61 70 70 |half of many app| 00000610 6c 69 63 61 74 69 6f 6e 73 20 77 72 69 74 74 65 |lications writte| 00000620 6e 0a 66 6f 72 20 74 68 65 20 46 72 65 65 4e 65 |n.for the FreeNe| 00000630 74 20 61 6e 64 2f 6f 72 20 41 63 6f 72 6e 20 54 |t and/or Acorn T| 00000640 43 50 2f 49 50 20 73 74 61 63 6b 73 2e 0a 0a 4e |CP/IP stacks...N| 00000650 6f 72 6d 61 6c 6c 79 2c 20 61 73 20 74 68 65 20 |ormally, as the | 00000660 6e 61 6d 65 2d 73 65 72 76 65 72 20 69 73 20 61 |name-server is a| 00000670 20 6d 61 63 68 69 6e 65 20 63 6f 6e 6e 65 63 74 | machine connect| 00000680 65 64 20 74 6f 20 79 6f 75 72 20 6c 6f 63 61 6c |ed to your local| 00000690 0a 6e 65 74 77 6f 72 6b 2c 20 74 68 65 20 74 69 |.network, the ti| 000006a0 6d 65 20 74 61 6b 65 6e 20 74 6f 20 67 65 74 20 |me taken to get | 000006b0 61 20 72 65 70 6c 79 20 66 72 6f 6d 20 61 20 6e |a reply from a n| 000006c0 61 6d 65 73 65 72 76 65 72 20 69 73 20 71 75 69 |ameserver is qui| 000006d0 74 65 20 73 68 6f 72 74 2c 0a 61 20 66 72 61 63 |te short,.a frac| 000006e0 74 69 6f 6e 20 6f 66 20 61 20 73 65 63 6f 6e 64 |tion of a second| 000006f0 20 6f 6e 20 61 20 6c 69 67 68 74 6c 79 20 6c 6f | on a lightly lo| 00000700 61 64 65 64 20 6e 65 74 77 6f 72 6b 20 61 6e 64 |aded network and| 00000710 20 61 20 6c 69 67 68 74 6c 79 20 6c 6f 61 64 65 | a lightly loade| 00000720 64 0a 6e 61 6d 65 2d 73 65 72 76 65 72 2e 0a 0a |d.name-server...| 00000730 48 6f 77 65 76 65 72 20 77 69 74 68 20 68 65 61 |However with hea| 00000740 76 69 6c 79 20 6c 6f 61 64 65 64 20 6e 65 74 77 |vily loaded netw| 00000750 6f 72 6b 73 20 61 6e 64 20 6e 61 6d 65 73 65 72 |orks and nameser| 00000760 76 65 72 73 2c 20 6f 72 20 69 66 20 74 68 65 20 |vers, or if the | 00000770 71 75 65 72 79 0a 68 61 73 20 74 6f 20 62 65 20 |query.has to be | 00000780 73 65 6e 74 20 6f 76 65 72 20 73 65 72 69 61 6c |sent over serial| 00000790 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 76 69 61 20 | connection via | 000007a0 61 20 6d 6f 64 65 6d 20 74 6f 20 61 20 6e 61 6d |a modem to a nam| 000007b0 65 73 65 72 76 65 72 20 6f 6e 20 74 68 65 0a 49 |eserver on the.I| 000007c0 6e 74 65 72 6e 65 74 2c 20 74 68 65 20 74 69 6d |nternet, the tim| 000007d0 65 20 74 61 6b 65 6e 20 66 6f 72 20 74 68 65 20 |e taken for the | 000007e0 72 65 73 70 6f 6e 73 65 20 63 61 6e 20 62 65 20 |response can be | 000007f0 71 75 69 74 65 20 6c 6f 6e 67 2c 20 65 73 70 65 |quite long, espe| 00000800 63 69 61 6c 6c 79 0a 77 69 74 68 20 74 68 65 20 |cially.with the | 00000810 72 65 63 65 6e 74 20 75 70 73 75 72 67 65 20 69 |recent upsurge i| 00000820 6e 20 49 6e 74 65 72 6e 65 74 20 75 73 65 2e 20 |n Internet use. | 00000830 41 6c 73 6f 2c 20 69 6e 20 63 69 72 63 75 6d 73 |Also, in circums| 00000840 74 61 6e 63 65 73 20 6f 66 20 68 65 61 76 79 0a |tances of heavy.| 00000850 6e 65 74 77 6f 72 6b 20 63 6f 6e 6a 65 73 74 69 |network conjesti| 00000860 6f 6e 2c 20 61 64 64 69 74 69 6f 6e 61 6c 20 71 |on, additional q| 00000870 75 65 72 69 65 73 20 63 61 75 73 65 64 20 62 79 |ueries caused by| 00000880 20 72 65 73 65 6e 64 69 6e 67 20 6f 66 20 72 65 | resending of re| 00000890 71 75 65 73 74 73 0a 74 68 61 74 20 68 61 76 65 |quests.that have| 000008a0 20 62 65 65 6e 20 64 65 65 6d 65 64 20 6c 6f 73 | been deemed los| 000008b0 74 20 66 75 72 74 68 65 72 20 64 65 67 72 61 64 |t further degrad| 000008c0 65 73 20 6e 65 74 77 6f 72 6b 20 70 65 72 66 6f |es network perfo| 000008d0 72 6d 61 6e 63 65 2e 0a 0a 54 68 65 20 6f 62 76 |rmance...The obv| 000008e0 69 6f 75 73 20 73 6f 6c 75 74 69 6f 6e 20 69 73 |ious solution is| 000008f0 20 74 6f 20 73 6f 6d 65 68 6f 77 20 72 65 64 75 | to somehow redu| 00000900 63 65 20 74 68 65 20 64 65 70 65 6e 64 61 6e 63 |ce the dependanc| 00000910 79 20 75 70 6f 6e 20 74 68 65 0a 6e 61 6d 65 2d |y upon the.name-| 00000920 73 65 72 76 65 72 20 66 6f 72 20 70 72 6f 63 65 |server for proce| 00000930 73 73 69 6e 67 20 71 75 65 72 69 65 73 20 65 76 |ssing queries ev| 00000940 65 72 79 20 74 69 6d 65 20 79 6f 75 20 6d 61 6b |ery time you mak| 00000950 65 20 61 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 74 |e a connection t| 00000960 6f 0a 61 6e 6f 74 68 65 72 20 6e 61 6d 65 64 20 |o.another named | 00000970 68 6f 73 74 2e 0a 0a 54 68 69 73 20 77 68 61 74 |host...This what| 00000980 20 73 65 74 73 20 74 68 69 73 20 72 65 73 6f 6c | sets this resol| 00000990 76 65 72 20 61 70 61 72 74 20 66 72 6f 6d 20 74 |ver apart from t| 000009a0 68 65 20 74 79 70 65 73 20 6f 66 20 72 65 73 6f |he types of reso| 000009b0 6c 76 65 72 20 63 6f 6d 6d 6f 6e 6c 79 0a 66 6f |lver commonly.fo| 000009c0 75 6e 64 20 6f 6e 20 64 65 73 6b 74 6f 70 20 63 |und on desktop c| 000009d0 6f 6d 70 75 74 65 72 73 2e 20 49 74 20 72 65 6d |omputers. It rem| 000009e0 65 6d 62 65 72 73 20 69 6e 66 6f 72 6d 61 74 69 |embers informati| 000009f0 6f 6e 20 72 65 63 65 6e 74 6c 79 20 6f 62 74 61 |on recently obta| 00000a00 69 6e 65 64 0a 66 72 6f 6d 20 61 20 6e 61 6d 65 |ined.from a name| 00000a10 2d 73 65 72 76 65 72 20 69 6e 20 61 20 63 61 63 |-server in a cac| 00000a20 68 65 20 61 6e 64 20 73 6f 20 69 73 20 6f 66 74 |he and so is oft| 00000a30 65 6e 20 61 62 6c 65 20 74 6f 20 67 69 76 65 20 |en able to give | 00000a40 61 6e 20 69 6e 73 74 61 6e 74 0a 72 65 73 70 6f |an instant.respo| 00000a50 6e 63 65 20 74 6f 20 61 20 72 65 70 65 61 74 20 |nce to a repeat | 00000a60 6f 66 20 72 65 63 65 6e 74 20 73 69 6d 69 6c 61 |of recent simila| 00000a70 72 20 71 75 65 72 79 2c 20 6d 61 6b 69 6e 67 20 |r query, making | 00000a80 69 74 20 76 65 72 79 20 61 70 70 72 6f 70 72 69 |it very appropri| 00000a90 61 74 65 0a 66 6f 72 20 75 73 65 20 77 68 65 72 |ate.for use wher| 00000aa0 65 20 74 68 65 20 6e 61 6d 65 73 65 72 76 65 72 |e the nameserver| 00000ab0 20 69 73 20 61 74 20 74 68 65 20 6f 74 68 65 72 | is at the other| 00000ac0 20 65 6e 64 20 6f 66 20 61 20 64 69 61 6c 20 75 | end of a dial u| 00000ad0 70 20 63 6f 6e 6e 65 63 74 69 6f 6e 0a 76 69 61 |p connection.via| 00000ae0 20 61 20 6d 6f 64 65 6d 2e 0a 0a 54 68 65 20 63 | a modem...The c| 00000af0 61 63 68 65 69 6e 67 20 6d 65 74 68 6f 64 73 20 |acheing methods | 00000b00 75 73 65 64 20 61 72 65 20 73 75 63 68 20 74 68 |used are such th| 00000b10 61 74 20 73 6f 20 6c 6f 6e 67 20 61 73 20 74 68 |at so long as th| 00000b20 65 20 6e 61 6d 65 2d 73 65 72 76 65 72 73 20 61 |e name-servers a| 00000b30 72 65 0a 70 72 6f 76 69 64 69 6e 67 20 61 63 63 |re.providing acc| 00000b40 75 72 61 74 65 20 69 6e 66 6f 72 6d 61 74 69 6f |urate informatio| 00000b50 6e 20 61 62 6f 75 74 20 74 68 65 20 6c 69 66 65 |n about the life| 00000b60 20 74 69 6d 65 20 6f 66 20 64 61 74 61 20 72 65 | time of data re| 00000b70 74 72 69 65 76 65 64 2c 0a 74 68 65 6e 20 74 68 |trieved,.then th| 00000b80 65 20 63 61 63 68 65 20 77 69 6c 6c 20 6f 6e 6c |e cache will onl| 00000b90 79 20 67 69 76 65 20 75 70 74 6f 20 64 61 74 65 |y give upto date| 00000ba0 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20 61 6e | information, an| 00000bb0 64 20 77 69 6c 6c 0a 61 75 74 6f 6d 61 74 69 63 |d will.automatic| 00000bc0 61 6c 6c 79 20 72 65 6d 6f 76 65 20 69 6e 66 6f |ally remove info| 00000bd0 72 6d 61 74 69 6f 6e 20 63 6f 6e 73 69 64 65 72 |rmation consider| 00000be0 65 64 20 6f 75 74 20 6f 66 20 64 61 74 65 2c 20 |ed out of date, | 00000bf0 65 6e 73 75 72 69 6e 67 20 61 0a 66 72 65 73 68 |ensuring a.fresh| 00000c00 20 63 6f 70 79 20 69 73 20 72 65 61 64 20 66 72 | copy is read fr| 00000c10 6f 6d 20 74 68 65 20 6e 61 6d 65 73 65 72 76 65 |om the nameserve| 00000c20 72 2e 0a 20 20 0a 0a 53 65 74 74 69 6e 67 20 55 |r.. ..Setting U| 00000c30 70 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 0a 52 65 |p.==========..Re| 00000c40 73 6f 6c 76 65 72 20 63 6f 6e 66 69 67 75 72 61 |solver configura| 00000c50 74 69 6f 6e 20 69 73 20 73 74 6f 72 65 64 20 69 |tion is stored i| 00000c60 6e 20 74 68 65 20 66 69 6c 65 20 22 21 46 72 65 |n the file "!Fre| 00000c70 65 55 73 65 72 2e 46 69 6c 65 73 2e 52 65 73 43 |eUser.Files.ResC| 00000c80 6f 6e 66 22 2e 0a 4f 70 74 69 6f 6e 73 20 69 6e |onf"..Options in| 00000c90 20 74 68 69 73 20 66 69 6c 65 20 61 72 65 20 61 | this file are a| 00000ca0 73 20 66 6f 6c 6c 6f 77 73 3a 20 28 53 65 65 20 |s follows: (See | 00000cb0 65 78 61 6d 70 6c 65 29 0a 0a 6e 61 6d 65 73 65 |example)..namese| 00000cc0 72 76 65 72 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |rver.----------.| 00000cd0 0a 6e 61 6d 65 73 65 72 76 65 72 20 3c 69 70 5f |.nameserver <ip_| 00000ce0 61 64 64 72 65 73 73 3e 0a 0a 0a 49 6e 74 65 72 |address>...Inter| 00000cf0 6e 65 74 20 61 64 64 72 65 73 73 20 28 69 6e 20 |net address (in | 00000d00 64 6f 74 20 6e 6f 74 61 74 69 6f 6e 29 20 6f 66 |dot notation) of| 00000d10 20 61 20 6e 61 6d 65 20 73 65 72 76 65 72 20 74 | a name server t| 00000d20 68 61 74 20 74 68 65 20 72 65 73 6f 6c 76 65 72 |hat the resolver| 00000d30 0a 73 68 6f 75 6c 64 20 71 75 65 72 79 2e 0a 0a |.should query...| 00000d40 55 70 20 74 6f 20 4d 41 58 4e 53 20 28 63 75 72 |Up to MAXNS (cur| 00000d50 72 65 6e 74 6c 79 20 33 29 20 6e 61 6d 65 20 73 |rently 3) name s| 00000d60 65 72 76 65 72 73 20 6d 61 79 20 62 65 20 6c 69 |ervers may be li| 00000d70 73 74 65 64 2c 20 6f 6e 65 20 70 65 72 20 6b 65 |sted, one per ke| 00000d80 79 77 6f 72 64 2e 0a 0a 49 66 20 74 68 65 72 65 |yword...If there| 00000d90 20 61 72 65 20 6d 75 6c 74 69 70 6c 65 20 73 65 | are multiple se| 00000da0 72 76 65 72 73 2c 20 74 68 65 20 72 65 73 6f 6c |rvers, the resol| 00000db0 76 65 72 20 6c 69 62 72 61 72 79 20 71 75 65 72 |ver library quer| 00000dc0 69 65 73 20 74 68 65 6d 20 69 6e 20 74 68 65 0a |ies them in the.| 00000dd0 6f 72 64 65 72 20 6c 69 73 74 65 64 2e 20 49 66 |order listed. If| 00000de0 20 6e 6f 20 6e 61 6d 65 73 65 72 76 65 72 20 65 | no nameserver e| 00000df0 6e 74 72 69 65 73 20 61 72 65 20 70 72 65 73 65 |ntries are prese| 00000e00 6e 74 2c 20 74 68 65 20 64 65 66 61 75 6c 74 20 |nt, the default | 00000e10 69 73 20 74 6f 0a 75 73 65 20 74 68 65 20 6e 61 |is to.use the na| 00000e20 6d 65 20 73 65 72 76 65 72 20 6f 6e 20 74 68 65 |me server on the| 00000e30 20 6c 6f 63 61 6c 20 6d 61 63 68 69 6e 65 2e 20 | local machine. | 00000e40 28 54 68 65 20 61 6c 67 6f 72 69 74 68 6d 20 75 |(The algorithm u| 00000e50 73 65 64 20 69 73 20 74 6f 20 74 72 79 0a 61 20 |sed is to try.a | 00000e60 6e 61 6d 65 20 73 65 72 76 65 72 2c 20 61 6e 64 |name server, and| 00000e70 20 69 66 20 74 68 65 20 71 75 65 72 79 20 74 69 | if the query ti| 00000e80 6d 65 73 20 6f 75 74 2c 20 74 72 79 20 74 68 65 |mes out, try the| 00000e90 20 6e 65 78 74 2c 20 75 6e 74 69 6c 20 6f 75 74 | next, until out| 00000ea0 20 6f 66 0a 6e 61 6d 65 20 73 65 72 76 65 72 73 | of.name servers| 00000eb0 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 74 72 |, then repeat tr| 00000ec0 79 69 6e 67 20 61 6c 6c 20 74 68 65 20 6e 61 6d |ying all the nam| 00000ed0 65 20 73 65 72 76 65 72 73 20 75 6e 74 69 6c 20 |e servers until | 00000ee0 61 20 6d 61 78 69 6d 75 6d 0a 6e 75 6d 62 65 72 |a maximum.number| 00000ef0 20 6f 66 20 72 65 74 72 69 65 73 20 61 72 65 20 | of retries are | 00000f00 6d 61 64 65 29 2e 0a 0a 0a 64 6f 6d 61 69 6e 0a |made)....domain.| 00000f10 2d 2d 2d 2d 2d 2d 0a 0a 4c 6f 63 61 6c 20 64 6f |------..Local do| 00000f20 6d 61 69 6e 20 6e 61 6d 65 2e 0a 0a 4d 6f 73 74 |main name...Most| 00000f30 20 71 75 65 72 69 65 73 20 66 6f 72 20 6e 61 6d | queries for nam| 00000f40 65 73 20 77 69 74 68 69 6e 20 74 68 69 73 20 64 |es within this d| 00000f50 6f 6d 61 69 6e 20 63 61 6e 20 75 73 65 20 73 68 |omain can use sh| 00000f60 6f 72 74 20 6e 61 6d 65 73 20 72 65 6c 61 74 69 |ort names relati| 00000f70 76 65 0a 74 6f 20 74 68 65 20 6c 6f 63 61 6c 20 |ve.to the local | 00000f80 64 6f 6d 61 69 6e 2e 0a 0a 49 66 20 6e 6f 20 64 |domain...If no d| 00000f90 6f 6d 61 69 6e 20 65 6e 74 72 79 20 69 73 20 70 |omain entry is p| 00000fa0 72 65 73 65 6e 74 2c 20 74 68 65 20 64 6f 6d 61 |resent, the doma| 00000fb0 69 6e 20 69 73 20 64 65 74 65 72 6d 69 6e 65 64 |in is determined| 00000fc0 20 66 72 6f 6d 20 74 68 65 20 6c 6f 63 61 6c 0a | from the local.| 00000fd0 68 6f 73 74 20 6e 61 6d 65 20 72 65 74 75 72 6e |host name return| 00000fe0 65 64 20 62 79 20 67 65 74 68 6f 73 74 6e 61 6d |ed by gethostnam| 00000ff0 65 28 29 20 74 68 65 20 64 6f 6d 61 69 6e 20 70 |e() the domain p| 00001000 61 72 74 20 69 73 20 74 61 6b 65 6e 20 74 6f 20 |art is taken to | 00001010 62 65 0a 65 76 65 72 79 74 68 69 6e 67 20 61 66 |be.everything af| 00001020 74 65 72 20 74 68 65 20 66 69 72 73 74 20 27 2e |ter the first '.| 00001030 27 2e 0a 0a 46 69 6e 61 6c 6c 79 2c 20 69 66 20 |'...Finally, if | 00001040 74 68 65 20 68 6f 73 74 20 6e 61 6d 65 20 64 6f |the host name do| 00001050 65 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 61 |es not contain a| 00001060 20 64 6f 6d 61 69 6e 20 70 61 72 74 2c 20 74 68 | domain part, th| 00001070 65 20 72 6f 6f 74 0a 64 6f 6d 61 69 6e 20 69 73 |e root.domain is| 00001080 20 61 73 73 75 6d 65 64 2e 0a 0a 0a 73 65 61 72 | assumed....sear| 00001090 63 68 0a 2d 2d 2d 2d 2d 2d 0a 0a 53 65 61 72 63 |ch.------..Searc| 000010a0 68 20 6c 69 73 74 20 66 6f 72 20 68 6f 73 74 2d |h list for host-| 000010b0 6e 61 6d 65 20 6c 6f 6f 6b 75 70 2e 0a 0a 54 68 |name lookup...Th| 000010c0 65 20 73 65 61 72 63 68 20 6c 69 73 74 20 69 73 |e search list is| 000010d0 20 6e 6f 72 6d 61 6c 6c 79 20 64 65 74 65 72 6d | normally determ| 000010e0 69 6e 65 64 20 66 72 6f 6d 20 74 68 65 20 6c 6f |ined from the lo| 000010f0 63 61 6c 20 64 6f 6d 61 69 6e 20 6e 61 6d 65 3b |cal domain name;| 00001100 20 62 79 0a 64 65 66 61 75 6c 74 2c 20 69 74 20 | by.default, it | 00001110 62 65 67 69 6e 73 20 77 69 74 68 20 74 68 65 20 |begins with the | 00001120 6c 6f 63 61 6c 20 64 6f 6d 61 69 6e 20 6e 61 6d |local domain nam| 00001130 65 2c 20 74 68 65 6e 20 73 75 63 63 65 73 73 69 |e, then successi| 00001140 76 65 20 70 61 72 65 6e 74 0a 64 6f 6d 61 69 6e |ve parent.domain| 00001150 73 20 74 68 61 74 20 68 61 76 65 20 61 74 20 6c |s that have at l| 00001160 65 61 73 74 20 74 77 6f 20 63 6f 6d 70 6f 6e 65 |east two compone| 00001170 6e 74 73 20 69 6e 20 74 68 65 69 72 20 6e 61 6d |nts in their nam| 00001180 65 73 2e 20 54 68 69 73 20 6d 61 79 20 62 65 0a |es. This may be.| 00001190 63 68 61 6e 67 65 64 20 62 79 20 6c 69 73 74 69 |changed by listi| 000011a0 6e 67 20 74 68 65 20 64 65 73 69 72 65 64 20 64 |ng the desired d| 000011b0 6f 6d 61 69 6e 20 73 65 61 72 63 68 20 70 61 74 |omain search pat| 000011c0 68 20 66 6f 6c 6c 6f 77 69 6e 67 20 74 68 65 0a |h following the.| 000011d0 5c 66 49 73 65 61 72 63 68 5c 66 50 20 6b 65 79 |\fIsearch\fP key| 000011e0 77 6f 72 64 20 77 69 74 68 20 73 70 61 63 65 73 |word with spaces| 000011f0 20 6f 72 20 74 61 62 73 20 73 65 70 61 72 61 74 | or tabs separat| 00001200 69 6e 67 20 74 68 65 20 6e 61 6d 65 73 2e 0a 0a |ing the names...| 00001210 4d 6f 73 74 20 72 65 73 6f 6c 76 65 72 20 71 75 |Most resolver qu| 00001220 65 72 69 65 73 20 77 69 6c 6c 20 62 65 20 61 74 |eries will be at| 00001230 74 65 6d 70 74 65 64 20 75 73 69 6e 67 20 65 61 |tempted using ea| 00001240 63 68 20 63 6f 6d 70 6f 6e 65 6e 74 20 6f 66 20 |ch component of | 00001250 74 68 65 0a 73 65 61 72 63 68 20 70 61 74 68 20 |the.search path | 00001260 69 6e 20 74 75 72 6e 20 75 6e 74 69 6c 20 61 20 |in turn until a | 00001270 6d 61 74 63 68 20 69 73 20 66 6f 75 6e 64 2e 0a |match is found..| 00001280 0a 4e 6f 74 65 20 74 68 61 74 20 74 68 69 73 20 |.Note that this | 00001290 70 72 6f 63 65 73 73 20 6d 61 79 20 62 65 20 73 |process may be s| 000012a0 6c 6f 77 20 61 6e 64 20 77 69 6c 6c 20 67 65 6e |low and will gen| 000012b0 65 72 61 74 65 20 61 20 6c 6f 74 20 6f 66 20 6e |erate a lot of n| 000012c0 65 74 77 6f 72 6b 0a 74 72 61 66 66 69 63 20 69 |etwork.traffic i| 000012d0 66 20 74 68 65 20 73 65 72 76 65 72 73 20 66 6f |f the servers fo| 000012e0 72 20 74 68 65 20 6c 69 73 74 65 64 20 64 6f 6d |r the listed dom| 000012f0 61 69 6e 73 20 61 72 65 20 6e 6f 74 20 6c 6f 63 |ains are not loc| 00001300 61 6c 2c 20 61 6e 64 20 74 68 61 74 0a 71 75 65 |al, and that.que| 00001310 72 69 65 73 20 77 69 6c 6c 20 74 69 6d 65 20 6f |ries will time o| 00001320 75 74 20 69 66 20 6e 6f 20 73 65 72 76 65 72 20 |ut if no server | 00001330 69 73 20 61 76 61 69 6c 61 62 6c 65 20 66 6f 72 |is available for| 00001340 20 6f 6e 65 20 6f 66 20 74 68 65 20 64 6f 6d 61 | one of the doma| 00001350 69 6e 73 2e 0a 0a 54 68 65 20 73 65 61 72 63 68 |ins...The search| 00001360 20 6c 69 73 74 20 69 73 20 63 75 72 72 65 6e 74 | list is current| 00001370 6c 79 20 6c 69 6d 69 74 65 64 20 74 6f 20 73 69 |ly limited to si| 00001380 78 20 64 6f 6d 61 69 6e 73 0a 77 69 74 68 20 61 |x domains.with a| 00001390 20 74 6f 74 61 6c 20 6f 66 20 32 35 36 20 63 68 | total of 256 ch| 000013a0 61 72 61 63 74 65 72 73 2e 0a 0a 0a 73 6f 72 74 |aracters....sort| 000013b0 6c 69 73 74 0a 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 53 |list.--------..S| 000013c0 6f 72 74 6c 69 73 74 20 61 6c 6c 6f 77 73 20 61 |ortlist allows a| 000013d0 64 64 72 65 73 73 65 73 20 72 65 74 75 72 6e 65 |ddresses returne| 000013e0 64 20 62 79 20 67 65 74 68 6f 73 74 62 79 6e 61 |d by gethostbyna| 000013f0 6d 65 20 74 6f 20 62 65 20 73 6f 72 74 65 64 2e |me to be sorted.| 00001400 0a 0a 41 20 73 6f 72 74 6c 69 73 74 20 69 73 20 |..A sortlist is | 00001410 73 70 65 63 69 66 69 65 64 20 62 79 20 49 50 20 |specified by IP | 00001420 61 64 64 72 65 73 73 20 6e 65 74 6d 61 73 6b 20 |address netmask | 00001430 70 61 69 72 73 2e 20 54 68 65 20 6e 65 74 6d 61 |pairs. The netma| 00001440 73 6b 20 69 73 0a 6f 70 74 69 6f 6e 61 6c 20 61 |sk is.optional a| 00001450 6e 64 20 64 65 66 61 75 6c 74 73 20 74 6f 20 74 |nd defaults to t| 00001460 68 65 20 6e 61 74 75 72 61 6c 20 6e 65 74 6d 61 |he natural netma| 00001470 73 6b 20 6f 66 20 74 68 65 20 6e 65 74 2e 20 54 |sk of the net. T| 00001480 68 65 20 49 50 20 61 64 64 72 65 73 73 0a 61 6e |he IP address.an| 00001490 64 20 6f 70 74 69 6f 6e 61 6c 20 6e 65 74 77 6f |d optional netwo| 000014a0 72 6b 20 70 61 69 72 73 20 61 72 65 20 73 65 70 |rk pairs are sep| 000014b0 65 72 61 74 65 64 20 62 79 20 73 6c 61 73 68 65 |erated by slashe| 000014c0 73 2e 20 55 70 20 74 6f 20 31 30 20 70 61 69 72 |s. Up to 10 pair| 000014d0 73 20 6d 61 79 0a 62 65 20 73 70 65 63 69 66 69 |s may.be specifi| 000014e0 65 64 2e 0a 0a 65 2e 67 2e 20 73 6f 72 74 6c 69 |ed...e.g. sortli| 000014f0 73 74 20 31 33 30 2e 31 35 35 2e 31 36 30 2e 30 |st 130.155.160.0| 00001500 2f 32 35 35 2e 32 35 35 2e 32 34 30 2e 30 20 31 |/255.255.240.0 1| 00001510 33 30 2e 31 35 35 2e 30 2e 30 0a 0a 0a 6f 70 74 |30.155.0.0...opt| 00001520 69 6f 6e 73 0a 2d 2d 2d 2d 2d 2d 2d 0a 0a 4f 70 |ions.-------..Op| 00001530 74 69 6f 6e 73 20 61 6c 6c 6f 77 73 20 63 65 72 |tions allows cer| 00001540 74 61 69 6e 20 69 6e 74 65 72 6e 61 6c 20 72 65 |tain internal re| 00001550 73 6f 6c 76 65 72 20 76 61 72 69 61 62 6c 65 73 |solver variables| 00001560 20 74 6f 20 62 65 20 6d 6f 64 69 66 69 65 64 2e | to be modified.| 00001570 0a 0a 54 68 65 20 73 79 6e 74 61 78 20 69 73 0a |..The syntax is.| 00001580 0a 6f 70 74 69 6f 6e 73 20 3c 6f 70 74 69 6f 6e |.options <option| 00001590 3e 20 2e 2e 2e 0a 0a 77 68 65 72 65 20 3c 6f 70 |> .....where <op| 000015a0 74 69 6f 6e 3e 20 69 73 20 6f 6e 65 20 6f 66 20 |tion> is one of | 000015b0 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 3a 0a 0a |the following:..| 000015c0 64 65 62 75 67 20 20 20 73 65 74 73 20 52 45 53 |debug sets RES| 000015d0 5f 44 45 42 55 47 20 69 6e 20 5f 72 65 73 2e 6f |_DEBUG in _res.o| 000015e0 70 74 69 6f 6e 73 2e 0a 0a 6e 64 6f 74 73 20 20 |ptions...ndots | 000015f0 20 73 65 74 73 20 61 20 74 68 72 65 73 68 6f 6c | sets a threshol| 00001600 64 20 66 6f 72 20 74 68 65 20 6e 75 6d 62 65 72 |d for the number| 00001610 20 6f 66 20 64 6f 74 73 20 77 68 69 63 68 20 6d | of dots which m| 00001620 75 73 74 20 61 70 70 65 61 72 20 69 6e 20 61 0a |ust appear in a.| 00001630 20 20 20 20 20 20 20 20 6e 61 6d 65 20 67 69 76 | name giv| 00001640 65 6e 20 74 6f 20 72 65 73 5f 71 75 65 72 79 20 |en to res_query | 00001650 28 73 65 65 20 72 65 73 6f 6c 76 65 72 29 20 62 |(see resolver) b| 00001660 65 66 6f 72 65 20 61 6e 20 69 6e 69 74 69 61 6c |efore an initial| 00001670 0a 20 20 20 20 20 20 20 20 61 62 73 6f 6c 75 74 |. absolut| 00001680 65 20 71 75 65 72 79 20 77 69 6c 6c 20 62 65 20 |e query will be | 00001690 6d 61 64 65 2e 20 20 54 68 65 20 64 65 66 61 75 |made. The defau| 000016a0 6c 74 20 66 6f 72 20 6e 20 69 73 20 31 2c 20 6d |lt for n is 1, m| 000016b0 65 61 6e 69 6e 67 0a 20 20 20 20 20 20 20 20 74 |eaning. t| 000016c0 68 61 74 20 69 66 20 74 68 65 72 65 20 61 72 65 |hat if there are| 000016d0 20 61 6e 79 20 64 6f 74 73 20 69 6e 20 61 20 6e | any dots in a n| 000016e0 61 6d 65 2c 20 74 68 65 20 6e 61 6d 65 20 77 69 |ame, the name wi| 000016f0 6c 6c 20 62 65 20 74 72 69 65 64 0a 20 20 20 20 |ll be tried. | 00001700 20 20 20 20 66 69 72 73 74 20 61 73 20 61 6e 20 | first as an | 00001710 61 62 73 6f 6c 75 74 65 20 6e 61 6d 65 20 62 65 |absolute name be| 00001720 66 6f 72 65 20 61 6e 79 20 73 65 61 72 63 68 20 |fore any search | 00001730 6c 69 73 74 20 65 6c 65 6d 65 6e 74 73 20 61 72 |list elements ar| 00001740 65 0a 20 20 20 20 20 20 20 20 61 70 70 65 6e 64 |e. append| 00001750 65 64 20 74 6f 20 69 74 2e 0a 0a 0a 0a 63 61 63 |ed to it.....cac| 00001760 68 65 73 69 7a 65 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d |hesize.---------| 00001770 0a 0a 45 6e 61 62 6c 65 73 20 74 68 65 20 52 52 |..Enables the RR| 00001780 20 63 61 63 68 65 2e 20 56 61 6c 75 65 73 20 6d | cache. Values m| 00001790 61 79 20 62 65 20 67 69 76 65 6e 20 61 73 20 3c |ay be given as <| 000017a0 6e 3e 20 62 79 74 65 73 2c 20 6f 72 20 3c 6e 3e |n> bytes, or <n>| 000017b0 6b 20 6b 62 79 74 65 73 2e 0a 53 69 7a 65 20 6c |k kbytes..Size l| 000017c0 65 73 73 20 74 68 61 6e 20 31 30 32 34 20 61 72 |ess than 1024 ar| 000017d0 65 20 72 6f 75 6e 64 65 64 20 75 70 74 6f 20 31 |e rounded upto 1| 000017e0 30 32 34 2e 0a 0a 0a 63 61 63 68 65 6c 6f 61 64 |024....cacheload| 000017f0 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a 0a 52 65 61 64 |.---------..Read| 00001800 20 52 52 73 20 66 72 6f 6d 20 6f 6e 65 20 6f 72 | RRs from one or| 00001810 20 6d 6f 72 65 20 66 69 6c 65 20 69 6e 74 6f 20 | more file into | 00001820 74 68 65 20 63 61 63 68 65 2e 20 49 66 20 79 6f |the cache. If yo| 00001830 75 20 61 72 65 20 73 61 76 69 6e 67 20 74 68 65 |u are saving the| 00001840 0a 63 61 63 68 65 20 61 74 20 73 68 75 74 64 6f |.cache at shutdo| 00001850 77 6e 2c 20 74 68 65 6e 20 6f 6e 65 20 6f 66 20 |wn, then one of | 00001860 74 68 65 73 20 66 69 6c 65 73 20 73 68 6f 75 6c |thes files shoul| 00001870 64 20 62 65 20 74 68 65 20 63 61 63 68 65 20 66 |d be the cache f| 00001880 69 6c 65 2e 0a 0a 66 6f 72 20 65 67 3a 0a 63 61 |ile...for eg:.ca| 00001890 63 68 65 6c 6f 61 64 20 20 72 65 73 62 6f 6f 74 |cheload resboot| 000018a0 20 72 65 73 63 61 63 68 65 0a 0a 0a 63 61 63 68 | rescache...cach| 000018b0 65 73 61 76 65 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0a |esave.---------.| 000018c0 0a 54 68 69 73 20 73 65 74 73 20 77 68 65 72 65 |.This sets where| 000018d0 20 74 68 65 20 63 61 63 68 65 20 69 73 20 73 61 | the cache is sa| 000018e0 76 65 64 20 74 6f 20 61 74 20 73 68 75 74 64 6f |ved to at shutdo| 000018f0 77 6e 2e 0a 0a 0a 72 65 74 72 79 0a 2d 2d 2d 2d |wn....retry.----| 00001900 2d 0a 0a 54 68 69 73 20 73 65 74 73 20 74 68 65 |-..This sets the| 00001910 20 6e 75 6d 62 65 72 20 6f 66 20 72 65 74 72 69 | number of retri| 00001920 65 73 20 61 74 74 65 6d 70 74 65 64 20 74 6f 20 |es attempted to | 00001930 65 61 63 68 20 6e 61 6d 65 73 65 72 76 65 72 20 |each nameserver | 00001940 28 64 65 66 61 75 6c 74 20 34 29 0a 0a 74 69 6d |(default 4)..tim| 00001950 65 6f 75 74 0a 2d 2d 2d 2d 2d 2d 2d 0a 0a 54 68 |eout.-------..Th| 00001960 69 73 20 73 65 74 73 20 74 68 65 20 6d 69 6e 20 |is sets the min | 00001970 61 6e 64 20 6d 61 78 20 74 69 6d 65 6f 75 74 73 |and max timeouts| 00001980 20 62 65 74 77 65 65 6e 20 72 65 74 72 79 69 6e | between retryin| 00001990 67 20 74 68 65 20 73 61 6d 65 20 6e 61 6d 65 73 |g the same names| 000019a0 65 72 76 65 72 20 61 67 61 69 6e 2e 0a 41 66 74 |erver again..Aft| 000019b0 65 72 20 65 61 63 68 20 72 65 74 72 79 2c 20 74 |er each retry, t| 000019c0 68 65 20 74 69 6d 65 6f 75 74 20 69 73 20 64 6f |he timeout is do| 000019d0 75 62 6c 65 64 20 75 70 74 6f 20 74 68 65 20 6d |ubled upto the m| 000019e0 61 78 20 76 61 6c 75 65 2e 0a 0a 4e 61 6d 65 73 |ax value...Names| 000019f0 65 72 76 65 72 20 72 65 74 72 69 65 73 20 61 72 |erver retries ar| 00001a00 65 20 64 73 74 72 69 62 75 74 65 64 20 74 68 72 |e dstributed thr| 00001a10 6f 75 67 68 20 74 68 65 20 74 69 6d 65 6f 75 74 |ough the timeout| 00001a20 20 70 65 72 69 6f 64 2c 20 73 6f 20 69 66 20 74 | period, so if t| 00001a30 68 65 0a 74 69 6d 65 6f 75 74 20 70 65 72 69 6f |he.timeout perio| 00001a40 64 20 69 73 20 36 20 73 65 63 6f 6e 64 73 2c 20 |d is 6 seconds, | 00001a50 61 6e 64 20 33 20 6e 61 6d 65 73 65 72 76 65 72 |and 3 nameserver| 00001a60 73 20 68 61 76 65 20 62 65 20 73 70 65 63 69 66 |s have be specif| 00001a70 69 65 64 2c 20 74 68 65 0a 6e 65 78 74 20 6e 61 |ied, the.next na| 00001a80 6d 65 73 65 72 76 65 72 20 69 73 20 74 72 69 65 |meserver is trie| 00001a90 64 20 32 20 73 65 63 6f 6e 64 73 20 61 66 74 65 |d 2 seconds afte| 00001aa0 72 20 74 68 65 20 66 69 72 73 74 2e 0a 0a 0a 2d |r the first....-| 00001ab0 2d 2d 2d 0a 0a 0a 54 68 65 20 64 6f 6d 61 69 6e |---...The domain| 00001ac0 20 61 6e 64 20 73 65 61 72 63 68 20 6b 65 79 77 | and search keyw| 00001ad0 6f 72 64 73 20 61 72 65 20 6d 75 74 75 61 6c 6c |ords are mutuall| 00001ae0 79 20 65 78 63 6c 75 73 69 76 65 2e 20 49 66 20 |y exclusive. If | 00001af0 6d 6f 72 65 20 74 68 61 6e 20 6f 6e 65 0a 69 6e |more than one.in| 00001b00 73 74 61 6e 63 65 20 6f 66 20 74 68 65 73 65 20 |stance of these | 00001b10 6b 65 79 77 6f 72 64 73 20 69 73 20 70 72 65 73 |keywords is pres| 00001b20 65 6e 74 2c 20 74 68 65 20 6c 61 73 74 20 69 6e |ent, the last in| 00001b30 73 74 61 6e 63 65 20 77 69 6e 73 2e 0a 0a 54 68 |stance wins...Th| 00001b40 65 20 73 65 61 72 63 68 20 6b 65 79 77 6f 72 64 |e search keyword| 00001b50 20 6f 66 20 61 20 73 79 73 74 65 6d 27 73 20 72 | of a system's r| 00001b60 65 73 6f 6c 76 2e 63 6f 6e 66 20 66 69 6c 65 20 |esolv.conf file | 00001b70 63 61 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 |can be overridde| 00001b80 6e 20 6f 6e 20 61 0a 70 65 72 2d 70 72 6f 63 65 |n on a.per-proce| 00001b90 73 73 20 62 61 73 69 73 20 62 79 20 73 65 74 74 |ss basis by sett| 00001ba0 69 6e 67 20 74 68 65 20 65 6e 76 69 72 6f 6e 6d |ing the environm| 00001bb0 65 6e 74 20 76 61 72 69 61 62 6c 65 20 4c 4f 43 |ent variable LOC| 00001bc0 41 4c 44 4f 4d 41 49 4e 20 74 6f 20 61 0a 73 70 |ALDOMAIN to a.sp| 00001bd0 61 63 65 2d 73 65 70 61 72 61 74 65 64 20 6c 69 |ace-separated li| 00001be0 73 74 20 6f 66 20 73 65 61 72 63 68 20 64 6f 6d |st of search dom| 00001bf0 61 69 6e 73 2e 0a 0a 54 68 65 20 6f 70 74 69 6f |ains...The optio| 00001c00 6e 73 20 6b 65 79 77 6f 72 64 20 6f 66 20 61 20 |ns keyword of a | 00001c10 73 79 73 74 65 6d 27 73 20 72 65 73 6f 6c 76 2e |system's resolv.| 00001c20 63 6f 6e 66 20 66 69 6c 65 20 63 61 6e 20 62 65 |conf file can be| 00001c30 20 61 6d 65 6e 64 65 64 20 6f 6e 20 61 0a 70 65 | amended on a.pe| 00001c40 72 2d 70 72 6f 63 65 73 73 20 62 61 73 69 73 20 |r-process basis | 00001c50 62 79 20 73 65 74 74 69 6e 67 20 74 68 65 20 65 |by setting the e| 00001c60 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 |nvironment varia| 00001c70 62 6c 65 20 52 45 53 5f 4f 50 54 49 4f 4e 53 20 |ble RES_OPTIONS | 00001c80 74 6f 20 61 0a 73 70 61 63 65 2d 73 65 70 61 72 |to a.space-separ| 00001c90 61 74 65 64 20 6c 69 73 74 20 6f 66 20 72 65 73 |ated list of res| 00001ca0 6f 6c 76 65 72 20 6f 70 74 69 6f 6e 73 20 61 73 |olver options as| 00001cb0 20 65 78 70 6c 61 69 6e 65 64 20 61 62 6f 76 65 | explained above| 00001cc0 20 75 6e 64 65 72 0a 6f 70 74 69 6f 6e 73 2e 0a | under.options..| 00001cd0 0a 54 68 65 20 6b 65 79 77 6f 72 64 20 61 6e 64 |.The keyword and| 00001ce0 20 76 61 6c 75 65 20 6d 75 73 74 20 61 70 70 65 | value must appe| 00001cf0 61 72 20 6f 6e 20 61 20 73 69 6e 67 6c 65 20 6c |ar on a single l| 00001d00 69 6e 65 2c 20 61 6e 64 20 74 68 65 20 6b 65 79 |ine, and the key| 00001d10 77 6f 72 64 0a 28 65 2e 67 2e 20 6e 61 6d 65 73 |word.(e.g. names| 00001d20 65 72 76 65 72 29 20 6d 75 73 74 20 73 74 61 72 |erver) must star| 00001d30 74 20 74 68 65 20 6c 69 6e 65 2e 20 20 54 68 65 |t the line. The| 00001d40 20 76 61 6c 75 65 20 66 6f 6c 6c 6f 77 73 20 74 | value follows t| 00001d50 68 65 20 6b 65 79 77 6f 72 64 2c 0a 73 65 70 61 |he keyword,.sepa| 00001d60 72 61 74 65 64 20 62 79 20 77 68 69 74 65 20 73 |rated by white s| 00001d70 70 61 63 65 2e 0a 0a 0a 50 72 6f 67 72 61 6d 6d |pace....Programm| 00001d80 65 72 20 49 6e 74 65 72 66 61 63 65 0a 3d 3d 3d |er Interface.===| 00001d90 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d |================| 00001da0 3d 0a 0a 54 68 69 73 20 66 69 6c 65 20 69 73 20 |=..This file is | 00001db0 69 6e 63 6f 6d 70 6c 65 74 65 2c 20 74 68 65 72 |incomplete, ther| 00001dc0 65 20 61 72 65 20 61 6c 73 6f 20 61 20 66 65 77 |e are also a few| 00001dd0 20 2a 63 6f 6d 6d 61 6e 64 73 2c 20 73 6f 6d 65 | *commands, some| 00001de0 20 6f 66 20 77 68 69 63 68 0a 61 72 65 20 69 6d | of which.are im| 00001df0 70 6c 65 6d 65 6e 74 65 64 2e 0a 0a 54 68 65 20 |plemented...The | 00001e00 53 57 49 20 49 6e 74 65 72 66 61 63 65 20 69 73 |SWI Interface is| 00001e10 20 61 73 20 66 6f 6c 6c 6f 77 73 3a 0a 0a 53 57 | as follows:..SW| 00001e20 49 20 49 6e 74 65 72 6e 65 74 5f 47 65 74 48 6f |I Internet_GetHo| 00001e30 73 74 42 79 4e 61 6d 65 20 26 34 36 30 30 30 0a |stByName &46000.| 00001e40 0a 4f 6e 20 65 6e 74 72 79 3a 0a 20 20 52 30 20 |.On entry:. R0 | 00001e50 3d 20 30 0a 20 20 52 31 20 3d 20 2d 3e 20 68 6f |= 0. R1 = -> ho| 00001e60 73 74 20 6e 61 6d 65 0a 0a 4f 6e 20 65 78 69 74 |st name..On exit| 00001e70 3a 0a 20 20 52 31 20 3d 20 70 6f 69 6e 74 65 72 |:. R1 = pointer| 00001e80 20 74 6f 20 68 6f 73 74 65 6e 74 20 73 74 72 75 | to hostent stru| 00001e90 63 74 75 72 65 20 6f 72 20 4e 55 4c 4c 20 69 66 |cture or NULL if| 00001ea0 20 6e 6f 74 20 66 6f 75 6e 64 0a 0a 0a 53 57 49 | not found...SWI| 00001eb0 20 49 6e 74 65 72 6e 65 74 5f 47 65 74 48 6f 73 | Internet_GetHos| 00001ec0 74 42 79 41 64 64 72 20 26 34 36 30 30 31 0a 4f |tByAddr &46001.O| 00001ed0 6e 20 65 6e 74 72 79 3a 0a 20 20 52 30 20 3d 20 |n entry:. R0 = | 00001ee0 30 0a 20 20 52 31 20 3d 20 2d 3e 20 68 6f 73 74 |0. R1 = -> host| 00001ef0 20 61 64 64 72 0a 20 20 52 32 20 3d 20 6c 65 6e | addr. R2 = len| 00001f00 20 6f 66 20 61 64 64 72 0a 20 20 52 33 20 3d 20 | of addr. R3 = | 00001f10 74 79 70 65 20 6f 66 20 61 64 64 72 0a 0a 4f 6e |type of addr..On| 00001f20 20 65 78 69 74 3a 0a 20 20 52 31 20 3d 20 70 6f | exit:. R1 = po| 00001f30 69 6e 74 65 72 20 74 6f 20 68 6f 73 74 65 6e 74 |inter to hostent| 00001f40 20 73 74 72 75 63 74 75 72 65 2c 20 6f 72 20 4e | structure, or N| 00001f50 55 4c 4c 20 69 66 20 6e 6f 74 20 66 6f 75 6e 64 |ULL if not found| 00001f60 0a 0a 57 68 65 72 65 20 74 68 65 20 68 6f 73 74 |..Where the host| 00001f70 65 6e 74 20 73 74 75 63 74 75 72 65 20 69 73 20 |ent stucture is | 00001f80 64 65 66 69 6e 65 64 20 61 73 20 62 65 6c 6f 77 |defined as below| 00001f90 2e 20 4e 6f 74 65 20 74 68 61 74 20 61 6c 6c 20 |. Note that all | 00001fa0 61 64 64 72 65 73 73 65 73 0a 61 72 65 20 67 69 |addresses.are gi| 00001fb0 76 65 6e 20 69 6e 20 6e 65 74 20 62 79 74 65 20 |ven in net byte | 00001fc0 6f 72 64 65 72 20 28 74 68 65 20 72 65 76 65 72 |order (the rever| 00001fd0 73 65 20 6f 66 20 74 68 65 20 6e 6f 72 6d 61 6c |se of the normal| 00001fe0 20 41 63 6f 72 6e 20 62 79 74 65 20 6f 72 64 65 | Acorn byte orde| 00001ff0 72 29 2e 0a 0a 73 74 72 75 63 74 20 68 6f 73 74 |r)...struct host| 00002000 65 6e 74 20 7b 0a 20 20 63 68 61 72 20 2a 68 5f |ent {. char *h_| 00002010 6e 61 6d 65 3b 20 20 20 20 20 20 20 20 20 20 20 |name; | 00002020 20 20 20 20 20 2f 2a 20 4f 66 66 69 63 69 61 6c | /* Official| 00002030 20 6e 61 6d 65 20 6f 66 20 68 6f 73 74 20 2a 2f | name of host */| 00002040 0a 20 20 63 68 61 72 20 2a 2a 68 5f 61 6c 69 61 |. char **h_alia| 00002050 73 65 73 3b 20 20 20 20 20 20 20 20 20 20 20 20 |ses; | 00002060 2f 2a 20 41 6c 74 65 72 6e 61 74 69 76 65 20 6e |/* Alternative n| 00002070 61 6d 65 73 20 66 6f 72 20 68 6f 73 74 20 2a 2f |ames for host */| 00002080 0a 20 20 69 6e 74 20 20 68 5f 61 64 64 72 74 79 |. int h_addrty| 00002090 70 65 3b 20 20 20 20 20 20 20 20 20 20 20 20 20 |pe; | 000020a0 2f 2a 20 48 6f 73 74 20 61 64 64 72 65 73 73 20 |/* Host address | 000020b0 74 79 70 65 20 2a 2f 0a 20 20 69 6e 74 20 20 68 |type */. int h| 000020c0 5f 6c 65 6e 67 74 68 3b 20 20 20 20 20 20 20 20 |_length; | 000020d0 20 20 20 20 20 20 20 2f 2a 20 4c 65 6e 67 74 68 | /* Length| 000020e0 20 6f 66 20 65 61 63 68 20 61 64 64 72 65 73 73 | of each address| 000020f0 20 2a 2f 0a 20 20 63 68 61 72 20 2a 2a 68 5f 61 | */. char **h_a| 00002100 64 64 72 5f 6c 69 73 74 3b 20 20 20 20 20 20 20 |ddr_list; | 00002110 20 20 20 2f 2a 20 4c 69 73 74 20 6f 66 20 61 64 | /* List of ad| 00002120 64 72 65 73 73 65 73 20 66 6f 72 20 68 6f 73 74 |dresses for host| 00002130 20 2a 2f 0a 23 64 65 66 69 6e 65 20 68 5f 61 64 | */.#define h_ad| 00002140 64 72 20 68 5f 61 64 64 72 5f 6c 69 73 74 5b 30 |dr h_addr_list[0| 00002150 5d 20 20 2f 2a 20 41 64 64 72 65 73 73 2c 20 66 |] /* Address, f| 00002160 6f 72 20 62 61 63 6b 20 63 6f 6d 70 61 74 61 62 |or back compatab| 00002170 69 6c 69 74 79 20 2a 2f 0a 7d 3b 0a 0a |ility */.};..| 0000217d