blob: 8d578caf75c1d8700262ed37abf625b5e518e2ed [file] [log] [blame]
DBus support must be enabled at compile-time and run-time. Ensure
that src/config.h contains the line
#define HAVE_DBUS.
and that /etc/dnsmasq.conf contains the line
Because dnsmasq can operate stand-alone from the DBus, and may need to provide
service before the dbus daemon is available, it will continue to run
if the DBus connection is not available at startup. The DBus will be polled
every 250ms until a connection is established. Start of polling and final
connection establishment are both logged. When dnsmasq establishes a
connection to the dbus, it sends the signal "Up". Anything controlling
the server settings in dnsmasq should re-invoke the SetServers method
(q.v.) when it sees this signal. This allows dnsmasq to be restarted
and avoids startup races with the provider of nameserver information.
Dnsmasq provides one service on the DBus:
and a single object: /uk/org/thekelleys/dnsmasq
Methods are of the form<method>
Available methods are:
Returns a string containing the version of dnsmasq running.
Returns nothing. Clears the domain name cache and re-reads
/etc/hosts. The same as sending dnsmasq a HUP signal.
Returns nothing. Takes a set of arguments representing the new
upstream DNS servers to be used by dnsmasq. IPv4 addresses are
represented as a UINT32 (in network byte order) and IPv6 addresses
are represented as sixteen BYTEs (since there is no UINT128 type).
Each server address may be followed by one or more STRINGS, which are
the domains for which the preceding server should be used.
UINT32: <address1>
UNIT32: <address2>
is equivalent to
--server=<address1> --server=<address2>
UINT32 <address1>
UINT32 <address2>
is equivalent to
--server=<address1> --server=/<address2>
UINT32 <address1>
UINT32 <address2>
UINT32 <address3>
is equivalent to
Am IPv4 address of is interpreted as "no address, local only",
UINT32: <>
STRING "local.domain"
is equivalent to
Each call to SetServers completely replaces the set of servers
specified by via the DBus, but it leaves any servers specified via the
command line or /etc/dnsmasq.conf or /etc/resolv.conf alone.
If dnsmasq's DHCP server is active, it will send signals over DBUS whenever
the DHCP lease database changes. Think of these signals as transactions on
a database with the IP address acting as the primary key.
Signals are of the form:<signal>
and their parameters are:
STRING "01:23:45:67:89:ab"
STRING "hostname.or.fqdn"
Available signals are:
This signal is emitted when a DHCP lease for a given IP address is created.
This signal is emitted when a DHCP lease for a given IP address is deleted.
This signal is emitted when a DHCP lease for a given IP address is updated.