xref: /openbsd-src/usr.sbin/unbound/doc/control_proto_spec.txt (revision 933707f3d2ba183a60794cf3344e3b4ddb6d4f5d)
1*933707f3Ssthen
2*933707f3SsthenSpecification for the unbound-control protocol.
3*933707f3Ssthen
4*933707f3SsthenServer listens on 8953 TCP (localhost by default). Client connects,
5*933707f3SsthenSSLv3 or TLSv1 connection setup (server selfsigned certificate,
6*933707f3Ssthenclient has cert signed by server certificate).
7*933707f3Ssthen
8*933707f3SsthenPort 8953 is registered with IANA as:
9*933707f3Ssthenub-dns-control  8953/tcp    unbound dns nameserver control
10*933707f3Ssthen# Wouter Wijngaards <wouter&nlnetlabs.nl> 10 May 2011
11*933707f3SsthenOn may 11 2011, ticket [IANA #442315].
12*933707f3Ssthen
13*933707f3SsthenQuery and Response
14*933707f3Ssthen------------------
15*933707f3SsthenClient sends
16*933707f3Ssthen	UBCT[version] [commandline] \n
17*933707f3Ssthen	fixed string UBCT1 (for version 1), then an ascii text line,
18*933707f3Ssthen	with a command, some whitespace allowed. Line ends with '\n'.
19*933707f3Ssthen
20*933707f3SsthenServer executes command. And sends reply in ascii text over channel,
21*933707f3Ssthencloses the channel when done.
22*933707f3Ssthen	in case of error the first line of the response is:
23*933707f3Ssthen		error <descriptive text possible> \n
24*933707f3Ssthen	or the remainder is data of the response, for many commands the
25*933707f3Ssthen	response is 'ok\n'.
26*933707f3Ssthen
27*933707f3SsthenQueries and responses
28*933707f3Ssthen---------------------
29*933707f3Ssthenstop
30*933707f3Ssthen	stops the server.
31*933707f3Ssthenreload
32*933707f3Ssthen	reloads the config file, and flushes the cache.
33*933707f3Ssthenverbosity <new value>
34*933707f3Ssthen	Change logging verbosity to new value.
35*933707f3Ssthenstats
36*933707f3Ssthen	output is a list of [name]=[value] lines.
37*933707f3Ssthen	clears the counters.
38*933707f3Ssthendump_cache
39*933707f3Ssthen	output is a text representation of the cache contents.
40*933707f3Ssthen	data ends with a line 'EOF' before connection close.
41*933707f3Ssthenload_cache
42*933707f3Ssthen	client sends cache contents (like from dump_cache), which is stored
43*933707f3Ssthen	in the cache. end of data indicated with a line with 'EOF' on it.
44*933707f3Ssthen	The data is sent after the query line.
45*933707f3Ssthenflush <name>
46*933707f3Ssthen	flushes some information regarding the name from the cache.
47*933707f3Ssthen	removes the A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR, SRV, NAPTR types.
48*933707f3Ssthen	Does not remove other types.
49*933707f3Ssthenflush_type <name> <RR type>
50*933707f3Ssthen	removes rrtype entry from the cache.
51*933707f3Ssthenflush_zone <name>
52*933707f3Ssthen	removes name and everything below that name from the cache.
53*933707f3Ssthen	has to search through the cache item by item, so this is slow.
54*933707f3Ssthenlookup <name>
55*933707f3Ssthen	see what servers would be queried for a lookup of the given name.
56*933707f3Ssthenlocal_zone_remove <name of local-zone entry>
57*933707f3Ssthen	the local-zone entry is removed.
58*933707f3Ssthen	All data from the local zone is also deleted.
59*933707f3Ssthen	If it did not exist, nothing happens.
60*933707f3Ssthenlocal_zone <name of local zone> <type>
61*933707f3Ssthen	As the config file entry. Adds new local zone or updates
62*933707f3Ssthen	existing zone type.
63*933707f3Ssthenlocal_data_remove <name>
64*933707f3Ssthen	Removes local-data (all types) name.
65*933707f3Ssthenlocal_data <resource record string>
66*933707f3Ssthen	Add new local data record (on the rest of the line).
67*933707f3Ssthen	local_data_add www.example.com. IN A 192.0.2.2
68*933707f3Ssthen	if no local_zone exists for it; a transparent zone with the same
69*933707f3Ssthen	name as the data is created.
70*933707f3SsthenOther commands in the unbound-control manual page.
71