blob: 07bffd471f362414e9641ed9e3d7160cd7fad819 [file] [log] [blame]
Simon Kelley3d8df262005-08-29 12:19:27 +01001DBus support must be enabled at compile-time and run-time. Ensure
2that src/config.h contains the line
3
4#define HAVE_DBUS.
5
6and that /etc/dnsmasq.conf contains the line
7
8enable-dbus
9
10Because dnsmasq can operate stand-alone from the DBus, and may need to provide
11service before the dbus daemon is available, it will continue to run
12if the DBus connection is not available at startup. The DBus will be polled
13every 250ms until a connection is established. Start of polling and final
14connection establishment are both logged. When dnsmasq establishes a
15connection to the dbus, it sends the signal "Up". Anything controlling
16the server settings in dnsmasq should re-invoke the SetServers method
17(q.v.) when it sees this signal. This allows dnsmasq to be restarted
18and avoids startup races with the provider of nameserver information.
19
20
21Dnsmasq provides one service on the DBus: uk.org.thekelleys.dnsmasq
22and a single object: /uk/org/thekelleys/dnsmasq
23
24Methods are of the form
25
26uk.org.thekelleys.<method>
27
28Available methods are:
29
30GetVersion
31----------
32Returns a string containing the version of dnsmasq running.
33
34ClearCache
35----------
36Returns nothing. Clears the domain name cache and re-reads
37/etc/hosts. The same as sending dnsmasq a HUP signal.
38
39SetServers
40----------
41Returns nothing. Takes a set of arguments representing the new
42upstream DNS servers to be used by dnsmasq. IPv4 addresses are
43represented as a UINT32 (in network byte order) and IPv6 addresses
44are represented as sixteen BYTEs (since there is no UINT128 type).
45Each server address may be followed by one or more STRINGS, which are
46the domains for which the preceding server should be used.
47
48Examples.
49
50UINT32: <address1>
51UNIT32: <address2>
52
53is equivalent to
54
55--server=<address1> --server=<address2>
56
57
58UINT32 <address1>
59UINT32 <address2>
60STRING "somedomain.com"
61
62is equivalent to
63
64--server=<address1> --server=/somedomain.com/<address2>
65
66UINT32 <address1>
67UINT32 <address2>
68STRING "somedomain.com"
69UINT32 <address3>
70STRING "anotherdomain.com"
71STRING "thirddomain.com"
72
73is equivalent to
74
75--server=<address1>
76--server=/somedomain.com/<address2>
77--server=/anotherdomain.com/thirddomain.com/<address3>
78
79Am IPv4 address of 0.0.0.0 is interpreted as "no address, local only",
80so
81
82UINT32: <0.0.0.0>
83STRING "local.domain"
84
85is equivalent to
86
87--local=/local.domain/
88
89
90Each call to SetServers completely replaces the set of servers
91specified by via the DBus, but it leaves any servers specified via the
92command line or /etc/dnsmasq.conf or /etc/resolv.conf alone.
93
94