44d8654a |
1 | |
88eae90a |
2 | GNU adns |
4f3f9880 |
3 | |
2e036093 |
4 | Advanced, easy to use, asynchronous-capable DNS client library and |
5 | utilities. |
4f3f9880 |
6 | |
aa958273 |
7 | adns is a resolver library for C (and C++) programs, and a collection |
8 | of useful DNS resolver utilities. In contrast with the existing |
9 | interfaces, gethostbyname et al and libresolv, it has the following |
10 | features: |
44d8654a |
11 | * It is reasonably easy to use for simple programs which just want |
12 | to translate names to addresses, look up MX records, etc. |
13 | * It can be used in an asynchronous, non-blocking, manner. Many |
14 | queries can be handled simultaneously. |
15 | * Responses are decoded automatically into a natural representation |
16 | for a C program - there is no need to deal with DNS packet |
17 | formats. |
18 | * Sanity checking (eg, name syntax checking, reverse/forward |
19 | correspondence, CNAME pointing to CNAME) is performed |
20 | automatically. |
21 | * Time-to-live, CNAME and other similar information is returned in |
4f3f9880 |
22 | an easy-to-use form, without getting in the way. |
44d8654a |
23 | * There is no global state in the library; resolver state is an |
24 | opaque data structure which the client creates explicitly. A |
25 | program can have several instances of the resolver. |
26 | * Errors are reported to the application in a way that distinguishes |
27 | the various causes of failure properly. |
28 | * Understands conventional resolv.conf, but this can overridden by |
29 | environment variables. |
30 | * Flexibility. For example, the application can tell adns to: ignore |
aa958273 |
31 | environment variables (for setuid programs), disable hostname |
32 | syntax sanity checks to return arbitrary data, override or ignore |
33 | resolv.conf in favour of supplied configuration, etc. |
44d8654a |
34 | * Believed to be correct ! For example, will correctly back off to |
35 | TCP in case of long replies or queries, or to other nameservers if |
36 | several are available. It has sensible handling of bad responses |
37 | etc. |
4f3f9880 |
38 | |
aa958273 |
39 | DNS utility programs |
40 | |
2e036093 |
41 | adns also comes with a number of utility programs for use from the |
42 | command line and in scripts: |
43 | * adnslogres is a much faster version of Apache's logresolv program. |
44 | * adnsresfilter is a filter which copies its input to its output, |
45 | replacing IP addresses by the corresponding names, without unduly |
46 | delaying the output. For example, you can usefully pipe the output |
47 | of netstat -n, tcpdump -ln, and the like, into it. |
48 | * adnshost is a general-purpose DNS lookup utility which can be used |
aa958273 |
49 | easily in from the command line and from shell scripts to do |
50 | simple lookups. In a more advanced mode it can be used as a |
51 | general-purpose DNS helper program for scripting languages which |
52 | can invoke and communicate with subprocesses. See the [1]usage |
53 | message for a summary of its capabilities. |
2e036093 |
54 | |
aa958273 |
55 | Technical note |
4f3f9880 |
56 | |
aa958273 |
57 | adns requires a real nameserver like [2]BIND or [3]Dents running on |
58 | the same system or a nearby one, which must be willing to provide |
59 | `recursive service'. I.e., adns is a `stub resolver'. All properly |
60 | configured UN*X and GNU systems will already have such nameserver(s); |
61 | they are usually listed in /etc/resolv.conf. |
a2638561 |
62 | |
63 | Documentation |
64 | |
65 | I'm afraid there is no manual yet. However, competent C programmers |
aa958273 |
66 | should be able to use the library based on the [4]commented adns.h |
67 | header file, and the usage messages for the programs should be |
68 | sufficient. |
4f3f9880 |
69 | |
70 | Feedback |
71 | |
0db612f3 |
72 | I'd be pleased if you would let me know if you're using my library in |
73 | your project, and what you think of it. |
74 | |
75 | If you are subscribed to adns-discuss please send feedback, including |
76 | bug reports, there; otherwise send mail to |
77 | adns-bugreports@chiark.greenend.org.uk. If you'd prefer that your |
78 | message wasn't forwarded to the adns-bugreports list, send it to |
aa958273 |
79 | adns-maint@chiark.greenend.org.uk. |
4f3f9880 |
80 | |
81 | Mailinglists |
82 | |
83 | I have set up mailinglists adns-announce and adns-discuss. The |
84 | announcements list is moderated and will contain only announcements of |
85 | important bugs, new versions, &c. The bug reports address mentioned |
86 | above is also a mailing list; feel free to subscribe to it. |
87 | |
aa958273 |
88 | There are [5]archives and subscription web pages, or you can subscribe |
4f3f9880 |
89 | by sending mail containing the word `subscribe' to |
90 | adns-announce-REQUEST@chiark.greenend.org.uk or |
91 | adns-discuss-REQUEST@chiark.greenend.org.uk. |
92 | |
93 | Download |
94 | |
aa958273 |
95 | Available for download from [6]chiark.greenend.org.uk are: |
96 | * The [7]current beta version as a gzipped tarfile. |
97 | * [8]adns.h API header file with comments (currently there is no |
a2638561 |
98 | manual, sorry). |
aa958273 |
99 | * All versions released so far are also available via [9]anonymous |
a2638561 |
100 | FTP. |
88eae90a |
101 | * A mirror of my CVS repository is available via rsync from |
102 | rsync.chiark.greenend.org.uk::ftp/users/ian/cvs-pub/adns (use FTP |
aa958273 |
103 | first to find your way around), or via [10]cvsweb. |
4f3f9880 |
104 | |
aa958273 |
105 | adns is also available from the [11]GNU Project FTP servers and their |
106 | [12]mirrors. |
4f3f9880 |
107 | |
108 | Copyright and licensing |
109 | |
89435c42 |
110 | adns is Copyright 1997-2000 Ian Jackson, Copyright 1999 Tony Finch, |
111 | and Copyright (C) 1991 Massachusetts Institute of Technology. |
4f3f9880 |
112 | |
113 | adns is free software; you can redistribute it and/or modify it under |
114 | the terms of the GNU General Public License as published by the Free |
115 | Software Foundation; either version 2 of the License, or (at your |
116 | option) any later version. |
117 | |
118 | This program and documentation is distributed in the hope that it will |
119 | be useful, but without any warranty; without even the implied warranty |
a2638561 |
120 | of merchantability or fitness for a particular purpose. See the |
aa958273 |
121 | [13]GNU General Public License for more details. |
4f3f9880 |
122 | |
123 | You should have received a copy of the GNU General Public License |
124 | along with adns, or one should be available above; if not, write to |
aa958273 |
125 | the [14]Free Software Foundation, 59 Temple Place - Suite 330, Boston, |
4f3f9880 |
126 | MA 02111-1307, USA, or email adns-maint@chiark.greenend.org.uk. |
127 | _________________________________________________________________ |
128 | |
aa958273 |
129 | [15]Ian Jackson / [16]adns-maint@chiark.greenend.org.uk; more [17]free |
4f3f9880 |
130 | software by me. |
131 | |
aa958273 |
132 | [18]GNU home page; [19]chiark home page; [20]site or mirror home page |
4f3f9880 |
133 | |
89435c42 |
134 | This web page is Copyright (C)1996-2000 Ian Jackson. See the |
aa958273 |
135 | [21]Copyright/acknowledgements. |
4f3f9880 |
136 | |
aa958273 |
137 | Use any browser - [22]Campaign for a non-browser-specific WWW |
4f3f9880 |
138 | |
139 | References |
140 | |
aa958273 |
141 | 1. http://www.chiark.greenend.org.uk/~ian/adns/usage/adnsresfilter_usage.text |
142 | 2. http://www.isc.org/view.cgi?/products/BIND/index.phtml |
143 | 3. http://www.dents.org/ |
144 | 4. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt |
145 | 5. http://www.chiark.greenend.org.uk/mailman/listinfo |
146 | 6. http://www.chiark.greenend.org.uk/~ian/adns/ |
147 | 7. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz |
148 | 8. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.txt |
149 | 9. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/ |
150 | 10. http://www.chiark.greenend.org.uk/ucgi/~ijackson/cvsweb/adns/ |
151 | 11. http://www.gnu.org/ |
152 | 12. http://www.gnu.org/order/ftp.html |
153 | 13. http://www.chiark.greenend.org.uk/~ian/COPYING.txt |
154 | 14. http://www.fsf.org/ |
155 | 15. http://www.chiark.greenend.org.uk/ |
156 | 16. mailto:adns-maint@chiark.greenend.org.uk |
157 | 17. http://www.chiark.greenend.org.uk/~ian/software/ |
158 | 18. http://www.gnu.org/ |
2e036093 |
159 | 19. http://www.chiark.greenend.org.uk/ |
aa958273 |
160 | 20. file://localhost/ |
161 | 21. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html |
162 | 22. http://www.anybrowser.org/campaign/ |