closes the channel when done.
in case of error the first line of the response is:
error <descriptive text possible> \n
- or the remainder is data of the response.
+ or the remainder is data of the response, for many commands the
+ response is 'ok\n'.
Queries and responses
---------------------
stop
- no output
+ stops the server.
reload
- no output
+ reloads the config file, and flushes the cache.
stats
output is a list of [name]=[value] lines.
clears the counters.
dump_cache
output is a text representation of the cache contents.
+ data ends with a line 'EOF' before connection close.
load_cache
- client sends cache contents (like from dump_cache), stored in the
- cache. If client sends 'ok' or 'error' lines at start, ignored.
- end of data indicated with a line with 'EOF' on it.
+ client sends cache contents (like from dump_cache), which is stored
+ in the cache. end of data indicated with a line with 'EOF' on it.
+ The data is sent after the query line.
flush_name <name>
flushes some information regarding the name from the cache.
removes the A, AAAA, NS, SOA, CNAME, DNAME, MX, PTR types.
flush_zone <name>
removes name and everything below that name from the cache.
has to search through the cache item by item, so this is slow.
-delegation <domain name>
- see what servers would be queried for the given domain name.
-info <domain name>
- see data about the domain name
+delegation <name>
+ see what servers would be queried for the given name.
+info <name>
+ see data about the name. Slow, searches the cache item by item.
local_zone_remove <name of local-zone entry>
the local-zone entry is removed.
All data from the local zone is also deleted.
If it did not exist, nothing happens.
-local_zone_add <name of local zone> <type>
+local_zone <name of local zone> <type>
As the config file entry. Adds new local zone or updates
existing zone type.
local_data_remove <name>
Removes local-data (all types) name.
-local_data_add <resource record string>
+local_data <resource record string>
Add new local data record (on the rest of the line).
local_data_add www.example.com. IN A 192.0.2.2
+ if no local_zone exists for it; a transparent zone with the same
+ name as the data is created.
+verbosity <new value>
+ Change logging verbosity to new value.
+
go_cmd(SSL* ssl, int argc, char* argv[])
{
char* cmd = "GET / HTTP/1.0\n\n";
- int r;
+ char* pre="UBCT";
+ char* space=" ";
+ char* newline="\n";
+ int r, i;
char buf[1024];
- if(SSL_write(ssl, cmd, (int)strlen(cmd)) <= 0)
+ if(SSL_write(ssl, pre, (int)strlen(pre)) <= 0)
+ ssl_err("could not SSL_write");
+ for(i=0; i<argc; i++) {
+ if(SSL_write(ssl, space, (int)strlen(space)) <= 0)
+ ssl_err("could not SSL_write");
+ if(SSL_write(ssl, argv[i], (int)strlen(argv[i])) <= 0)
+ ssl_err("could not SSL_write");
+ }
+ if(SSL_write(ssl, newline, (int)strlen(newline)) <= 0)
ssl_err("could not SSL_write");
while(1) {
ERR_clear_error();