Commit | Line | Data |
---|---|---|
2a9e6abd | 1 | GNU adns |
95ecb688 | 2 | |
1a0a5dbd | 3 | Advanced, easy to use, asynchronous-capable DNS client library and |
4 | utilities. | |
2a9e6abd | 5 | |
8e5a4960 | 6 | adns is a resolver library for C (and C++) programs, and a collection |
b6922f88 | 7 | of useful DNS resolver utilities. |
2a9e6abd | 8 | |
b6922f88 | 9 | C library |
10 | ||
11 | In contrast with the standard interfaces, gethostbyname et al and | |
12 | libresolv, it has the following features: | |
2a9e6abd IJ |
13 | * It is reasonably easy to use for simple programs which just want to |
14 | translate names to addresses, look up MX records, etc. | |
95ecb688 | 15 | * It can be used in an asynchronous, non-blocking, manner. Many |
16 | queries can be handled simultaneously. | |
17 | * Responses are decoded automatically into a natural representation | |
2a9e6abd IJ |
18 | for a C program - there is no need to deal with DNS packet and |
19 | RRDATA formats. | |
95ecb688 | 20 | * Sanity checking (eg, name syntax checking, reverse/forward |
2a9e6abd IJ |
21 | correspondence, CNAME pointing to CNAME) is performed automatically |
22 | by default. | |
23 | * Time-to-live, CNAME and other similar information is returned in an | |
24 | easy-to-use form, without getting in the way. | |
95ecb688 | 25 | * There is no global state in the library; resolver state is an |
26 | opaque data structure which the client creates explicitly. A | |
27 | program can have several instances of the resolver. | |
28 | * Errors are reported to the application in a way that distinguishes | |
29 | the various causes of failure properly. | |
2a9e6abd IJ |
30 | * adns understands conventional resolv.conf, but this can overridden |
31 | by environment variables. | |
95ecb688 | 32 | * Flexibility. For example, the application can tell adns to: ignore |
8e5a4960 | 33 | environment variables (for setuid programs), disable hostname |
34 | syntax sanity checks to return arbitrary data, override or ignore | |
35 | resolv.conf in favour of supplied configuration, etc. | |
95ecb688 | 36 | * Believed to be correct ! For example, will correctly back off to |
37 | TCP in case of long replies or queries, or to other nameservers if | |
38 | several are available. It has sensible handling of bad responses | |
39 | etc. | |
2a9e6abd | 40 | |
8e5a4960 | 41 | DNS utility programs |
42 | ||
1a0a5dbd | 43 | adns also comes with a number of utility programs for use from the |
44 | command line and in scripts: | |
45 | * adnslogres is a much faster version of Apache's logresolv program. | |
46 | * adnsresfilter is a filter which copies its input to its output, | |
47 | replacing IP addresses by the corresponding names, without unduly | |
48 | delaying the output. For example, you can usefully pipe the output | |
49 | of netstat -n, tcpdump -ln, and the like, into it. | |
50 | * adnshost is a general-purpose DNS lookup utility which can be used | |
2a9e6abd IJ |
51 | easily in from the command line and from shell scripts to do simple |
52 | lookups. In a more advanced mode it can be used as a | |
8e5a4960 | 53 | general-purpose DNS helper program for scripting languages which |
6c55e47e | 54 | can invoke and communicate with subprocesses. See the [1]adnshost |
55 | usage message for a summary of its capabilities. | |
2a9e6abd | 56 | |
0db99d9c | 57 | Documentation |
58 | ||
59 | I'm afraid there is no manual yet. However, competent C programmers | |
6c55e47e | 60 | should be able to use the library based on the [2]commented adns.h |
8e5a4960 | 61 | header file, and the usage messages for the programs should be |
62 | sufficient. | |
2a9e6abd | 63 | |
df1d1f3a | 64 | Feedback |
65 | ||
bd3fce65 | 66 | I'd be pleased if you would let me know if you're using my library in |
67 | your project, and what you think of it. | |
2a9e6abd IJ |
68 | |
69 | Bug reports should be reported to the [3]GNU Debbugs. Send an email to | |
70 | submit@debbugs.gnu.org and at the top of your email, in a paragraph of | |
71 | its own, write the single line | |
72 | Package: adns | |
73 | ||
74 | Your bug report will be published via to the adns-discuss list. | |
75 | ||
76 | Feedback and discussion takes place on the adns-discuss list. You can | |
77 | mail me privately at ijackson@chiark.greenend.org.uk. | |
78 | ||
df1d1f3a | 79 | Mailinglists |
80 | ||
81 | I have set up mailinglists adns-announce and adns-discuss. The | |
82 | announcements list is moderated and will contain only announcements of | |
2a9e6abd IJ |
83 | important bugs, new versions, etc. |
84 | ||
85 | There are [4]archives and subscription web pages, or you can subscribe | |
df1d1f3a | 86 | by sending mail containing the word `subscribe' to |
87 | adns-announce-REQUEST@chiark.greenend.org.uk or | |
88 | adns-discuss-REQUEST@chiark.greenend.org.uk. | |
2a9e6abd IJ |
89 | |
90 | Documentation | |
91 | ||
92 | * [5]adns.h API header file with documentation comments | |
93 | * [6]usage message for adnshost | |
94 | ||
95 | Download and source code | |
96 | ||
97 | * The [7]current release as a gzipped tarfile. | |
5a111351 IJ |
98 | * [8]Previous versions and other files (including OpenPGP |
99 | signatures). | |
2a9e6abd IJ |
100 | * [9]master git (version control) repository browser. |
101 | ||
102 | adns is also available from the [10]GNU Project FTP servers and their | |
103 | [11]mirrors. | |
104 | ||
105 | Installation note | |
106 | ||
5a111351 IJ |
107 | adns requires a real nameserver like BIND running on the same system or |
108 | a nearby one, which must be willing to provide `recursive service'. | |
109 | I.e., adns is a `stub resolver'. | |
2a9e6abd IJ |
110 | |
111 | adns requires that your real nameserver is on the same machine, or | |
112 | connected via a secure network, so that an attacker cannot fake the | |
113 | replies to adns's queries. | |
114 | ||
9b21b383 | 115 | References and related projects |
116 | ||
5a111351 IJ |
117 | * [12]Python bindings by Andy Dustman. |
118 | * [13]liboop event loop library has a built-in binding for adns. | |
119 | * [14]port to MS Visual Studio 6 C++ by Jarle Aase. | |
2a9e6abd | 120 | |
df1d1f3a | 121 | Copyright and licensing |
122 | ||
2a9e6abd IJ |
123 | adns is Copyright 1997-2000,2003,2006,2014 Ian Jackson, Copyright 2014 |
124 | Mark Wooding, Copyright 1999-2000,2003,2006 Tony Finch, and Copyright | |
125 | (C) 1991 Massachusetts Institute of Technology. | |
126 | ||
df1d1f3a | 127 | adns is free software; you can redistribute it and/or modify it under |
128 | the terms of the GNU General Public License as published by the Free | |
2a9e6abd | 129 | Software Foundation; either version 3 of the License, or (at your |
df1d1f3a | 130 | option) any later version. |
2a9e6abd | 131 | |
df1d1f3a | 132 | This program and documentation is distributed in the hope that it will |
133 | be useful, but without any warranty; without even the implied warranty | |
5a111351 | 134 | of merchantability or fitness for a particular purpose. See the [15]GNU |
2a9e6abd IJ |
135 | General Public License for more details. |
136 | ||
137 | You should have received a copy of the GNU General Public License along | |
138 | with adns, or one should be available above; if not, write to the | |
5a111351 | 139 | [16]Free Software Foundation or email ijackson@chiark.greenend.org.uk. |
2a9e6abd IJ |
140 | __________________________________________________________________ |
141 | ||
142 | Ian Jackson / ijackson@chiark.greenend.org.uk. | |
143 | ||
5a111351 | 144 | [17]GNU home page; [18]chiark home page; [19]site or mirror home page |
2a9e6abd IJ |
145 | |
146 | This web page is Copyright (C)1996-2005,2014 Ian Jackson. See the | |
5a111351 | 147 | [20]Copyright/acknowledgements. |
df1d1f3a | 148 | |
149 | References | |
150 | ||
5a111351 IJ |
151 | 1. http://www.chiark.greenend.org.uk/~ian/adns/docs/adnshost.txt |
152 | 2. http://www.chiark.greenend.org.uk/~ian/adns/docs/adns.h.txt | |
2a9e6abd IJ |
153 | 3. http://debbugs.gnu.org/ |
154 | 4. http://www.chiark.greenend.org.uk/mailman/listinfo | |
5a111351 IJ |
155 | 5. http://www.chiark.greenend.org.uk/~ian/adns/docs/adns.h.txt |
156 | 6. http://www.chiark.greenend.org.uk/~ian/adns/docs/adnshost.txt | |
2a9e6abd IJ |
157 | 7. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz |
158 | 8. http://www.chiark.greenend.org.uk/~ian/adns/ftp/ | |
159 | 9. http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git/adns.git/ | |
160 | 10. http://www.gnu.org/ | |
161 | 11. http://www.gnu.org/order/ftp.html | |
5a111351 IJ |
162 | 12. http://code.google.com/p/adns-python |
163 | 13. http://www.lysator.liu.se/liboop/ | |
164 | 14. http://adns.jgaa.com/ | |
165 | 15. http://www.chiark.greenend.org.uk/~ian/adns/docs/COPYING.txt | |
166 | 16. http://www.fsf.org/ | |
167 | 17. http://www.gnu.org/ | |
168 | 18. http://www.chiark.greenend.org.uk/ | |
169 | 19. file://localhost/ | |
170 | 20. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html |