• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

READMEH A D27-Feb-20223.5 KiB8670

TODOH A D27-Feb-2022975 2119

jdns.cH A D27-Feb-202276.5 KiB3,4052,699

jdns.hH A D27-Feb-202215.1 KiB508273

jdns.priH A D27-Feb-2022410 2823

jdns.proH A D27-Feb-2022106 107

jdns_mdnsd.cH A D27-Feb-202233.1 KiB1,129877

jdns_mdnsd.hH A D27-Feb-20224.5 KiB12139

jdns_p.hH A D27-Feb-20223.4 KiB9860

jdns_packet.cH A D27-Feb-202223.1 KiB1,009734

jdns_packet.hH A D27-Feb-20224.1 KiB11754

jdns_sys.cH A D27-Feb-202219.6 KiB838601

jdns_util.cH A D27-Feb-202233.6 KiB1,5581,318

main.cppH A D27-Feb-202213.4 KiB597527

qjdns.cppH A D27-Feb-202222.5 KiB1,048857

qjdns.hH A D27-Feb-20223.3 KiB159109

qjdns_sock.cppH A D27-Feb-20224.1 KiB185141

qjdns_sock.hH A D27-Feb-20221.4 KiB348

README

1JDNS
2----
3Date: October 1st, 2005
4Author: Justin Karneges <justin@affinix.com>
5
6JDNS is a simple DNS implementation that can perform normal DNS queries
7of any record type (notably SRV), as well as Multicast DNS queries and
8advertising.  Multicast support is based on Jeremie Miller's "mdnsd"
9implementation.
10
11For maximum flexibility, JDNS is written in C with no direct dependencies,
12and is licensed under the MIT license.  Your application must supply
13functionality to JDNS, such as UDP sending/receiving, via callbacks.
14
15For Qt users there is a wrapper available called QJDns.  jdns.pri can
16be used to include everything into a qmake project.  jdns.pro will build
17the sample Qt-based commandline tool 'jdns'.
18
19Features:
20  - DNS client "stub" resolver
21  - Can fetch any record type, but provides handy decoding for many
22    known types: A, AAAA, SRV, MX, TXT, etc.
23  - Performs retries, caching/expiration, and CNAME following
24  - Algorithm logic adapted from Q3Dns
25  - Multicast queries
26  - Multicast advertising
27
28Why?
29  - Trolltech is phasing out the Qt DNS implementation, which in Qt 4 has
30    been relegated to the Qt3Support module.  A replacement was desired.
31
32  - While there are many DNS libraries available, at the time of this
33    writing it was (and still may be) hard to find one that satisfies
34    three essential conditions: cross-platform friendliness (and this
35    includes Windows 9x!), the ability to integrate into existing
36    eventloops, sensible licensing (ie, not GPL).
37
38How to use:
39  - Prepare callbacks and call jdns_session_new()
40  - Call jdns_init_unicast() or jdns_init_multicast(), depending on
41    if you want regular or multicast DNS.  If you want both kinds, you
42    can always make two sessions.
43  - Make queries and have fun
44  - Call jdns_step() at the right times to advance JDNS processing
45
46What is left to you:
47  - The callback functions, obviously.
48  - Querying for several "qualified" names.  Here is what Q3Dns does:
49      Query for name as provided
50      Query for name + '.domain' (for every domain the computer is in)
51  - Detecting for '.local' in a name to be queried, and using that
52    to decide whether to query via Multicast or normal DNS.
53  - Recognition of IP addresses.  If you want an IP address to resolve
54    to itself, then do that yourself.  Passing an IP address as a DNS
55    name to JDNS won't work (especially since it wouldn't make any
56    sense in some contexts, like SRV).
57  - Recognition of known hosts.  If you want this, compare inputs against
58    jdns_system_dnsparams().
59  - For zeroconf/Bonjour, keep in mind that JDNS only provides Multicast
60    DNS capability.  DNS-SD and any higher layers would be your job.
61
62Using a custom DNS implementation has the drawback that it is difficult
63to take advantage of platform-specific features (for example, an OS-wide
64DNS cache or LDAP integration).
65
66An application strategy for normal DNS should probably be:
67  - If an A or AAAA record is desired, use a native lookup.
68  - Else, if the platform has advanced DNS features already (ie,
69    res_query), use those.
70  - Else, use JDNS.
71
72However, it may not be a bad idea at first to use JDNS for all occasions,
73so that it can be debugged.
74
75For Multicast DNS, awareness of the platform is doubly important.  There
76should only be one Multicast DNS "Responder" per computer, and using JDNS
77at the same time could result in a conflict.
78
79An application strategy for Multicast DNS should be:
80  - If the platform has a Multicast DNS daemon installed already, use
81    it somehow.
82  - Else, use JDNS.
83
84Have fun!
85
86