diff options
| author | Shulhan <ms@kilabit.info> | 2022-05-22 15:57:52 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-05-22 16:14:35 +0700 |
| commit | a676f04d2f8c1981fc953cc2e87adf059e23089a (patch) | |
| tree | d86300df47d53abdf7ccb0342f96ddd3a677fbd4 /_www/doc | |
| parent | bb08b5bb6ad6cf3e1c409db7d69ace4364e7bc8d (diff) | |
| download | rescached-a676f04d2f8c1981fc953cc2e87adf059e23089a.tar.xz | |
all: move the documentation under _www/doc directory
This also allow the latest/released documentation viewed on
the web user interface under /doc path.
While at it, reformat HTML and CSS files using js-beautify and
JavaScript files using clang-format [1].
[1] https://google.github.io/styleguide/jsguide.html#formatting
Diffstat (limited to '_www/doc')
| l--------- | _www/doc/CHANGELOG.adoc | 1 | ||||
| l--------- | _www/doc/README.adoc | 1 | ||||
| -rw-r--r-- | _www/doc/benchmark.adoc | 125 | ||||
| -rw-r--r-- | _www/doc/html.tmpl | 34 | ||||
| -rw-r--r-- | _www/doc/images/Screenshot_wui_environment.png | bin | 0 -> 158861 bytes | |||
| -rw-r--r-- | _www/doc/images/Screenshot_wui_frontpage.png | bin | 0 -> 344669 bytes | |||
| -rw-r--r-- | _www/doc/images/Screenshot_wui_hosts_blocks.png | bin | 0 -> 198326 bytes | |||
| -rw-r--r-- | _www/doc/images/Screenshot_wui_hosts_d.png | bin | 0 -> 125782 bytes | |||
| -rw-r--r-- | _www/doc/images/Screenshot_wui_zone_d.png | bin | 0 -> 91905 bytes | |||
| -rw-r--r-- | _www/doc/index.adoc | 35 | ||||
| -rw-r--r-- | _www/doc/rescached.cfg.adoc | 263 | ||||
| -rw-r--r-- | _www/doc/resolver.adoc | 460 |
12 files changed, 919 insertions, 0 deletions
diff --git a/_www/doc/CHANGELOG.adoc b/_www/doc/CHANGELOG.adoc new file mode 120000 index 0000000..dbe8cbb --- /dev/null +++ b/_www/doc/CHANGELOG.adoc @@ -0,0 +1 @@ +../../CHANGELOG.adoc
\ No newline at end of file diff --git a/_www/doc/README.adoc b/_www/doc/README.adoc new file mode 120000 index 0000000..35c2551 --- /dev/null +++ b/_www/doc/README.adoc @@ -0,0 +1 @@ +../../README.adoc
\ No newline at end of file diff --git a/_www/doc/benchmark.adoc b/_www/doc/benchmark.adoc new file mode 100644 index 0000000..baf856c --- /dev/null +++ b/_www/doc/benchmark.adoc @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> +// SPDX-License-Identifier: GPL-3.0-or-later += Benchmark + +Commit: e670b34 +Build: normal + +Config options, + +---- +dir.hosts=/etc/rescached/hosts.d +dir.master=/etc/rescached/master.d +debug = 0 +---- + +== resolverbench + +Result of benchmarking with local blocked host file, + +---- +master ms 0 % ./resolverbench 127.0.0.1:53 scripts/hosts.block += Benchmarking with 27367 messages += Total: 27367 += Failed: 0 += Elapsed time: 1.053238347s +---- + +== dnstrace + +Result of benchmarking with 10000 query and 100 concurrent connections, + +---- +master ms 0 % dnstrace --recurse --codes --io-errors -s 127.0.0.1:53 -t A -n 10000 -c 100 redsift.io +Benchmarking 127.0.0.1:53 via udp with 100 conncurrent requests + +Total requests: 1000000 of 1000000 (100.0%) +DNS success codes: 1000000 + +DNS response codes + NOERROR: 1000000 + +Time taken for tests: 10.318186376s +Questions per second: 96916.3 + +DNS timings, 1000000 datapoints + min: 0s + mean: 1.017194ms + [+/-sd]: 770.525µs + max: 39.845887ms + +DNS distribution, 1000000 datapoints + LATENCY | | COUNT ++-------------+---------------------------------------------+--------+ + 131.071µs | | 1722 + 393.215µs | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | 115890 + 655.359µs | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | 185089 + 917.503µs | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | 316551 + 1.179647ms | ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ | 300305 + 1.441791ms | ▄▄▄▄ | 31218 + 1.703935ms | ▄▄ | 12005 + 1.966079ms | ▄ | 6387 + 2.228223ms | ▄ | 5007 + 2.490367ms | | 3196 + 2.752511ms | | 2573 + 3.014655ms | | 2486 + 3.276799ms | | 2012 + 3.538943ms | | 1814 + 3.801087ms | | 1806 + 4.063231ms | | 1512 + 4.325375ms | | 1099 + 4.587519ms | | 1077 + 4.849663ms | | 785 + 5.111807ms | | 759 + 5.373951ms | | 901 + 5.636095ms | | 765 + 5.898239ms | | 874 + 6.160383ms | | 654 + 6.422527ms | | 476 + 6.684671ms | | 351 + 6.946815ms | | 294 + 7.208959ms | | 245 + 7.471103ms | | 292 + 7.733247ms | | 261 + 7.995391ms | | 255 + 8.257535ms | | 132 + 8.650751ms | | 396 + 9.175039ms | | 193 + 9.699327ms | | 78 + 10.223615ms | | 51 + 10.747903ms | | 102 + 11.272191ms | | 23 + 11.796479ms | | 0 + 12.320767ms | | 0 + 12.845055ms | | 0 + 13.369343ms | | 0 + 13.893631ms | | 0 + 14.417919ms | | 0 + 14.942207ms | | 0 + 15.466495ms | | 0 + 15.990783ms | | 0 + 16.515071ms | | 0 + 17.301503ms | | 0 + 18.350079ms | | 0 + 19.398655ms | | 192 + 20.447231ms | | 112 + 21.495807ms | | 0 + 22.544383ms | | 0 + 23.592959ms | | 0 + 24.641535ms | | 12 + 25.690111ms | | 28 + 26.738687ms | | 14 + 27.787263ms | | 5 + 28.835839ms | | 0 + 29.884415ms | | 0 + 30.932991ms | | 0 + 31.981567ms | | 0 + 33.030143ms | | 0 + 34.603007ms | | 0 + 36.700159ms | | 0 + 38.797311ms | | 1 +---- + +== Credits + +- https://github.com/redsift/dnstrace[dnstrace] diff --git a/_www/doc/html.tmpl b/_www/doc/html.tmpl new file mode 100644 index 0000000..4eea130 --- /dev/null +++ b/_www/doc/html.tmpl @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- SPDX-FileCopyrightText: 2022 M. Shulhan <ms@kilabit.info --> +<!-- SPDX-License-Identifier: GPL-3.0-or-later --> +<html lang="en"> + +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> + <link rel="icon" type="image/png" href="/favicon.png" /> + <link rel="stylesheet" href="/index.css" /> + <title>rescached | doc</title> +</head> + +<body> + <nav class="menu"> + <a href="/"> rescached </a> + / + <a href="/environment/"> Environment </a> + / + <a href="/block.d/"> block.d </a> + / + <a href="/hosts.d/"> hosts.d </a> + / + <a href="/zone.d/"> zone.d </a> + / + <a href="/doc/" class="active"> Documentation </a> + </nav> + + <div class="page"> + <div class="container">{{.Body}}</div> + </div> +</body> + +</html> diff --git a/_www/doc/images/Screenshot_wui_environment.png b/_www/doc/images/Screenshot_wui_environment.png Binary files differnew file mode 100644 index 0000000..0e8c60d --- /dev/null +++ b/_www/doc/images/Screenshot_wui_environment.png diff --git a/_www/doc/images/Screenshot_wui_frontpage.png b/_www/doc/images/Screenshot_wui_frontpage.png Binary files differnew file mode 100644 index 0000000..0ee949b --- /dev/null +++ b/_www/doc/images/Screenshot_wui_frontpage.png diff --git a/_www/doc/images/Screenshot_wui_hosts_blocks.png b/_www/doc/images/Screenshot_wui_hosts_blocks.png Binary files differnew file mode 100644 index 0000000..7eaebe2 --- /dev/null +++ b/_www/doc/images/Screenshot_wui_hosts_blocks.png diff --git a/_www/doc/images/Screenshot_wui_hosts_d.png b/_www/doc/images/Screenshot_wui_hosts_d.png Binary files differnew file mode 100644 index 0000000..b096fa0 --- /dev/null +++ b/_www/doc/images/Screenshot_wui_hosts_d.png diff --git a/_www/doc/images/Screenshot_wui_zone_d.png b/_www/doc/images/Screenshot_wui_zone_d.png Binary files differnew file mode 100644 index 0000000..52e7913 --- /dev/null +++ b/_www/doc/images/Screenshot_wui_zone_d.png diff --git a/_www/doc/index.adoc b/_www/doc/index.adoc new file mode 100644 index 0000000..3c9ff89 --- /dev/null +++ b/_www/doc/index.adoc @@ -0,0 +1,35 @@ +// SPDX-FileCopyrightText: 2022 M. Shulhan <ms@kilabit.info> +// SPDX-License-Identifier: GPL-3.0-or-later += rescached documentation +Shulhan <ms@kilabit.info> + +link:CHANGELOG.html[CHANGELOG]:: Log for each release. + +link:README.html[rescached]:: Manual page for rescached program. + +link:rescached.cfg.html[rescached.cfg]:: Manual page for rescached +configuration. + +link:resolver.html[resolver]:: Manual page for resolver. + +link:benchmark.html[Benchmark]:: The latest benchmark of rescached server. + + +[#todo] +== TODO + +* zone.d rr add - check for duplicate value. + +* Prioritize the order of hosts file to be loaded: +** block.d +** hosts.d +** zone.d +** /etc/hosts + +* Generate unique ID for each RR in caches/zone for deletion. + +* Move repository to sr.ht + +* Implement DNS type 65 + +* Implement DNSSec diff --git a/_www/doc/rescached.cfg.adoc b/_www/doc/rescached.cfg.adoc new file mode 100644 index 0000000..2e19cac --- /dev/null +++ b/_www/doc/rescached.cfg.adoc @@ -0,0 +1,263 @@ +// SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> +// SPDX-License-Identifier: GPL-3.0-or-later += RESCACHED.CONF(5) +:doctype: manpage +:man source: rescached.cfg +:man version: 2020.05.10 +:man manual: rescached.cfg + + +== NAME + +rescached.cfg - Configuration for rescached service + + +== SYNOPSIS + +/etc/rescached/rescached.cfg + + +== DESCRIPTION + +These file configure the behaviour of *rescached*(1) service. +This section will explain more about each option and how they effect +`rescached`. + +The configuration is using INI format where each options is grouped by header +in square bracket: + +* `[rescached]` +* `[dns "server"]` + + +== OPTIONS + +=== [rescached] + +This group of options contain the main configuration that related to +rescached. + +[#wui-listen] +==== wui.listen + +Format:: [host]:port +Default:: 127.0.0.1:5380 +Description:: The address to listen for web user interface. + +[#file-resolvconf] +==== file.resolvconf + +Format:: /any/path/to/file +Default:: /etc/rescached/resolv.conf +Description:: A path to dynamically generated *resolv.conf*(5) by +*resolvconf*(8). ++ +-- +If set, the nameserver values in referenced file will be used as "parent" name +server if no "parent" is defined in configuration file. + +To use this config, you must set either "dnsmasq_resolv", "pdnsd_resolv", or +"unbound_conf" in "/etc/resolvconf.conf" to point to +"/etc/rescached/resolv.conf". + +For example, +---- +resolv_conf=/etc/resolv.conf +name_servers=127.0.0.1 +dnsmasq_resolv=/etc/rescached/resolv.conf +#pdnsd_resolv=/etc/rescached/resolv.conf +#unbound_conf=/etc/rescached/resolv.conf +---- +-- + +[#debug] +==== debug + +Value:: +0::: log startup and errors. +1::: log startup, errors, request, response, caches, and exit status. +Format:: Number (0 or 1). +Default:: 0 +Description:: This option only used for debugging program or if user want to +monitor what kind of traffic goes in and out of rescached. + +[#dns_server] +=== [dns "server"] + +This group of options related to DNS server. + +[#parent] +==== parent + +Format:: + +---- +parent = "parent = " [ scheme "://"] ( ip-address / domain-name ) [ ":" port ] +scheme = ( "udp" / "https") +---- + +Default:: +* Address: udp://1.1.1.1 +* Port: 53 +Description:: List of parent DNS servers. ++ +When `rescached` receive a query from client (for example, your browser) and +when it does not have a cached answer for that query, it will forward the +query to one of the parent name servers. ++ +Using UDP as parent scheme, will automatically assume that the server also +capable of handling query in TCP. +This is required when client (for example, your browser) re-send the query +after receiving truncated UDP answer. +Any query received by `rescached` through TCP will forwarded to the parent +name server as TCP too, using the same address and port defined in one of UDP +parent. ++ +Please, do not use OpenDNS server. +If certain host-name not found (i.e. typo in host-name), OpenDNS will reply +with its own address, instead of replying with empty answer. +This will make `rescached` caching a false data and it may make your +application open or consume unintended resources. ++ +To check if your parent server reply the unknown host-name with no answer, use +*resolver*(1) tool. + +Example:: +---- +## Using UDP connection to forward request to parent name server. +parent = udp://1.1.1.1 + +## Using DNS over TLS to forward request to parent name server. +parent = https://1.1.1.1 + +## Using DNS over HTTPS to forward request to parent name server. +parent = https://kilabit.info/dns-query +---- + +[#listen] +==== listen + +Format:: <IP-ADDRESS>:<PORT> +Default:: 127.0.0.1:53 +Description:: Address in local network where `rescached` will listening for +query from client. ++ +If you want rescached to serve a query from another host in your local +network, change this value to `0.0.0.0:53`. + +[#http-port] +==== http.port + +Format:: Number +Default:: 443 +Description:: Port to serve DNS over HTTP. + +[#tls-port] +==== tls.port + +Format:: Number +Default:: 853 +Description:: Port to serve DNS over TLS. + +[#tls-certificate] +==== tls.certificate + +Format:: /path/to/file +Default:: (empty) +Description:: Path to certificate file to serve DNS over TLS and HTTPS. + + +[#tls-private_key] +==== tls.private_key + +Format:: /path/to/file +Default:: (empty) +Description:: Path to certificate private key file to serve DNS over TLS and +HTTPS. + +[#tls-allow_insecure] +==== tls.allow_insecure + +Format:: true | false +Default:: false +Description:: If its true, allow serving DoH and DoT with self-signed +certificate. + +[#doh-behind_proxy] +==== doh.behind_proxy + +Format:: true | false +Default:: false +Description:: If its true, serve DNS over HTTP only, even if +certificate files is defined. +This allow serving DNS request forwarded by another proxy server. + +[#cache-prune_delay] +==== cache.prune_delay + +Format:: Duration with time unit. Valid time units are "s", "m", "h". +Default:: 1h +Description:: Delay for pruning caches. ++ +Every N seconds/minutes/hours, rescached will traverse all +caches and remove response that has not been accessed less than +`cache.prune_threshold`. +Its value must be equal or greater than 1 hour (3600 seconds). + +[#cache-prune_threshold] +==== cache.prune_threshold + +Format:: Duration with time unit. Valid time units are "s", "m", "h". +Default:: -1h +Description:: The duration when the cache will be considered expired. +Its value must be negative and greater or equal than -1 hour (-3600 seconds). + +== FILES + +[#hosts-d] +=== /etc/rescached/hosts.d + +Path to hosts directory where rescached will load all hosts formatted files. + + +[#zone-d] +=== /etc/rescached/zone.d + +Path to zone directory where rescached will load all zone files. + + +== EXAMPLE + +Simple rescached configuration using dnscrypt-proxy that listen on port 54 as +parent resolver, with prune delay set to 60 seconds and threshold also to 60 +seconds. + +---- +[dns "server"] +parent=udp://127.0.0.1:54 +cache.prune_delay=60s +cache.prune_threshold=60s +---- + +Save the above script into `rescached.cfg` and run it, + + $ sudo rescached -config rescached.cfg + + +== AUTHOR + +`rescached` is developed by M. Shulhan (m.shulhan@gmail.com). + + +== LICENSE + +Copyright 2018, M. Shulhan (m.shulhan@gmail.com). +All rights reserved. + +Use of this source code is governed by a GPL-3.0 license that can be +found in the COPYING file. + + +== SEE ALSO + +*rescached*(1) diff --git a/_www/doc/resolver.adoc b/_www/doc/resolver.adoc new file mode 100644 index 0000000..de34a25 --- /dev/null +++ b/_www/doc/resolver.adoc @@ -0,0 +1,460 @@ +// SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> +// SPDX-License-Identifier: GPL-3.0-or-later += RESOLVER(1) +:doctype: manpage +:man source: resolver +:man version: 2022.04.15 +:man manual: resolver + + +== NAME + +resolver - command line interface for DNS and rescached server. + + +== SYNOPSIS + +resolver [-insecure] [-ns nameserver] [-server] <command> [args...] + + +== DESCRIPTION + +resolver is a tool to resolve hostname to IP address or to query services +on hostname by type (MX, SOA, TXT, etc.) using standard DNS protocol with UDP, +DNS over TLS (DoT), or DNS over HTTPS (DoH). + + +== OPTIONS + +The following options affect the commands operation. + +`-insecure`:: ++ +-- +Ignore invalid server certificate when querying DoT, DoH, or rescached server. +-- + +`-ns <nameserver>`:: ++ +-- +This option define the parent DNS server where the resolver send the query. +Default to one of "nameserver" in `/etc/resolv.conf`. + +The nameserver is defined in the following format, + + ("udp"/"tcp"/"https") "://" (domain / ip-address) [":" port] + +Examples, + +* udp://194.233.68.184:53 for querying with UDP, +* tcp://194.233.68.184:53 for querying with TCP, +* https://194.233.68.184:853 for querying with DNS over TLS (DoT), and +* https://kilabit.info/dns-query for querying with DNS over HTTPS (DoH). +-- + +`-server <rescached-URL>`:: ++ +-- +Set the rescached HTTP server where commands will send. +The rescached-URL use HTTP scheme: + + ("http" / "https") "://" (domain / ip-address) [":" port] + +Default to "https://127.0.0.1:5380" if its empty. +-- + +== COMMANDS + +=== QUERY + +query <domain / ip-address> [type] [class]:: ++ +-- +Query the domain or IP address with optional type and/or class. + +Unless the option "-ns" is given, the query command will use the +nameserver defined in the system resolv.conf file. + +The "type" parameter define DNS record type to be queried. +List of valid types, + +* A (1) - a host Address (default) +* NS (2) - an authoritative Name Server +* CNAME (5) - the Canonical NAME for an alias +* SOA (6) - marks the Start of a zone of Authority +* MB (7) - a MailBox domain name +* MG (8) - a Mail Group member +* MR (9) - a Mail Rename domain name +* NULL (10) - a null resource record +* WKS (11) - a Well Known Service description +* PTR (12) - a domain name PoinTeR +* HINFO (13) - Host INFOrmation +* MINFO (14) - mailbox or mail list information +* MX (15) - Mail Exchange +* TXT (16) - TeXT strings +* AAAA (28) - a host address in IPv6 +* SRV (33) - a SerViCe record + +The "class" parameter is optional, its either IN (default), CS, or HS. +-- + + +=== MANAGING BLOCK.D + +block.d disable <name>:: ++ +-- +Disable specific hosts on block.d. +-- + +block.d enable <name>:: ++ +-- +Enable specific hosts on block.d. +-- + +block.d update <name>:: ++ +-- +Fetch the latest hosts file from remote block.d URL defined by +its name. +On success, the hosts file will be updated and the server will be +restarted. +-- + + +=== MANAGING CACHES + +caches:: ++ +-- +Fetch and print all caches from rescached server. +-- + + +caches search <string>:: ++ +-- +Search the domain name in rescached caches. +This command can also be used to inspect each DNS message on the caches. +-- + +caches remove <string>:: ++ +-- +Remove the domain name from rescached caches. +If the parameter is "all", it will remove all caches. +-- + + +=== MANAGING ENVIRONMENT + +env:: ++ +-- +Fetch the current server environment and print it as JSON format to stdout. +-- + +env update <path-to-file / "-">:: ++ +-- +Update the server environment from JSON formatted file. +If the argument is "-", the new environment is read from stdin. +If the environment is valid, the server will be restarted. +-- + + +=== MANAGING HOSTS.D + +hosts.d create <name>:: ++ +-- +Create new hosts file inside the hosts.d directory with specific file +name. +-- + +hosts.d delete <name>:: ++ +-- +Delete hosts file inside the hosts.d directory by file name. +-- + +hosts.d get <name>:: ++ +-- +Get the content of hosts file inside the hosts.d directory by file name. +-- + + +=== MANAGING RECORD IN HOSTS.D + +hosts.d rr add <name> <domain> <value>:: ++ +-- +Insert a new record and save it to the hosts file identified by +"name". +If the domain name already exists, the new record will be appended +instead of replaced. +-- + +hosts.d rr delete <name> <domain>:: ++ +-- +Delete record from hosts file "name" by domain name. +-- + + +=== MANAGING ZONE.D + +`zone.d`:: ++ +Fetch and print all zones in the server, including their SOA. + +zone.d create <name>:: ++ +Create new zone file inside the zone.d directory. + +zone.d delete <name>:: ++ +Delete zone file inside the zone.d directory. + + +=== MANAGING RECORD IN ZONE.D + +`zone.d rr get <zone>`:: + +Get and print all records in the zone. + +zone.d rr add <zone> <"@" | subdomain> <ttl> <type> <class> <value> ...:: ++ +-- +Add new record into the zone file. + +The domain name can be set to origin using "@" or empty string, subdomain +(without ending with "."), or fully qualified domain name (end with "."). + +If ttl is set to 0, it will default to 604800 (7 days). + +List of valid type are A, NS, CNAME, PTR, MX, TXT, and AAAA. + +List of valid class are IN, CS, HS. + +The value parameter can be more than one, for example, the MX record +we pass two parameters: + + <pref> <exchange> + +See the example below for more information. +-- + +`zone.d rr delete <zone> <"@" | subdomain> <type> <class> <value>`:: ++ +-- +Delete record from zone by its subdomain, type, class, and value. +-- + + +== EXIT STATUS + +Upon exit and success +resolver+ will return 0, or 1 otherwise. + + +== EXAMPLES + +=== QUERY + +Query the IPv4 address for kilabit.info, + + $ resolver query kilabit.info + +Query the mail exchange (MX) for domain kilabit.info, + + $ resolver query kilabit.info MX + +Query the IPv4 address for kilabit.info using 127.0.0.1 at port 53 as +name server, + + $ resolver -ns=udp://127.0.0.1:53 query kilabit.info + +Query the IPv4 address of domain name "kilabit.info" using DNS over TLS at +name server 194.233.68.184, + + $ resolver -insecure -ns=https://194.233.68.184 query kilabit.info + +Query the IPv4 records of domain name "kilabit.info" using DNS over HTTPS on +name server kilabit.info, + + $ resolver -ns=https://kilabit.info/dns-query query kilabit.info + +Inspect the rescached's caches on server at http://127.0.0.1:5380, + + $ resolver -server=http://127.0.0.1:5380 caches + + +=== MANAGING CACHES + +Search caches that contains "bit" on the domain name, + + $ resolver caches search bit + +Remove caches that contains domain name "kilabit.info", + + $ resolver caches remove kilabit.info + +Remove all caches in the server, + + $ resolver caches remove all + + +=== MANAGING ENVIRONMENT + +Fetch and print current server environment, + + $ resolver env + +Update the server environment from JSON file in /tmp/env.json, + + $ resolver env update /tmp/env.json + +Update the server environment by reading JSON from standard input, + + $ cat /tmp/env.json | resolver env update - + + +=== MANAGING HOSTS.D + +Create new hosts file named "myhosts" inside the hosts.d directory, + + $ resolver hosts.d create myhosts + OK + +Delete hosts file named "myhosts" inside the hosts.d directory, + + $ resolver hosts.d delete myhosts + OK + +Get the content of hosts file named "myhosts" inside the hosts.d directory, + + $ resolver hosts.d get myhosts + [ + { + "Value": "127.0.0.1", + "Name": "localhost", + "Type": 1, + "Class": 1, + "TTL": 604800 + }, + { + "Value": "::1", + "Name": "localhost", + "Type": 28, + "Class": 1, + "TTL": 604800 + } + ] + +=== MANAGING RECORD IN HOSTS.D + +Add new record "127.0.0.1 my.hosts" to hosts file named "hosts", + + $ resolver hosts.d rr add hosts my.hosts 127.0.0.1 + { + "Value": "127.0.0.1", + "Name": "my.hosts", + "Type": 1, + "Class": 1, + "TTL": 604800 + } + +Delete record "my.hosts" from hosts file "hosts", + + $ resolver hosts.d rr delete hosts my.hosts + { + "Value": "127.0.0.1", + "Name": "my.hosts", + "Type": 1, + "Class": 1, + "TTL": 604800 + } + +=== MANAGING ZONE.D + +Print all zone in the server, + + $ resolver zone.d + my.zone + SOA: {MName:my.zone RName: Serial:0 Refresh:0 Retry:0 Expire:0 Minimum:0} + + +=== MANAGING RECORD IN ZONE.D + +Assume that we have create zone "my.zone". + +Get all records in the zone "my.zone", + + $ resolver zone.d rr get my.zone + my.zone + 604800 MX IN map[Exchange:mail.my.zone Preference:10] + 604800 A IN 127.0.0.2 + 604800 A IN 127.0.0.3 + www.my.zone + 604800 A IN 192.168.1.2 + +Add IPv4 address "127.0.0.1" for domain my.zone, + + $ resolver zone.d rr add my.zone @ 0 A IN 127.0.0.1 + +or + + $ resolver zone.d rr add my.zone "" 0 A IN 127.0.0.1 + { + "Value": "127.0.0.1", + "Name": "my.zone", + "Type": 1, + "Class": 1, + "TTL": 604800 + } + +and to delete the above record, + + $ resolver zone.d rr delete my.zone @ A IN 127.0.0.1 + OK + +Add subdomain "www" with IPv4 address "192.168.1.2" to zone "my.zone", + + $ resolver zone.d rr add my.zone www 0 A IN 192.168.1.2 + { + "Value": "192.168.1.2", + "Name": "www.my.zone", + "Type": 1, + "Class": 1, + "TTL": 604800 + } + +and to delete the above record, + + $ resolver zone.d rr delete my.zone www A IN 192.168.1.2 + OK + +== AUTHOR + +This software is developed by M. Shulhan (ms@kilabit.info). + + +== LICENSE + +Copyright 2018, M. Shulhan (ms@kilabit.info). +All rights reserved. + +Use of this source code is governed by a GPL 3.0 license that can be +found in the COPYING file. + + +== LINKS + +Source code repository: https://github.com/shuLhan/rescached-go + + +== SEE ALSO + +*rescached*(1), *rescached.cfg*(5) |
