Skip to content

Commit

Permalink
Fix build warnings and some whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
gthess committed Oct 19, 2022
1 parent 2855f5a commit bbb20ca
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions source/developer/libunbound-tutorial/async-lookup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ program from the :doc:`resolve-a-name` section.
while(!done) {
usleep(100000); /* wait 1/10 of a second */
printf("time passed (%d) ..\n", i++);
retval = ``ub_process``(ctx);
retval = ub_process(ctx);
if(retval != 0) {
printf("resolve error: %s\n", ub_strerror(retval));
return 1;
Expand Down Expand Up @@ -132,4 +132,4 @@ descriptor that becomes readable when new data is available (for use with
The function ``ub_wait`` (not shown in example) can be used to wait for the
asynchronous lookups to complete. For example, when the main program continues
to set up a user GUI after starting the lookup, then if it runs out of work
before the result arrives, it can use ``ub_wait`` to block until data arrives.
before the result arrives, it can use ``ub_wait`` to block until data arrives.
2 changes: 1 addition & 1 deletion source/getting-started/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The :doc:`/manpages/unbound` manpage shows that the :option:`-d` flag will start
Unbound in this mode. The manpage also shows that we can use the :option:`-c`
flag to specify the path to the config file, so we can use the one we created.
We also recommend increasing the verbosity of the logging to 1 or 2, to see
what's actually happening (:option:`-v` or :option:`-vv`).
what's actually happening (``-v`` or ``-vv``).

.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions source/reference/history/prototype-resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Unbound Resolver Prototype

*The following is information regarding the Java based prototype for Unbound.
The Java prototype was superseded by a C version, available* `here
<https://www.nlnetlabs.nl/projects/unbound/about/>`_. *Older prototype versions
<https://www.nlnetlabs.nl/projects/unbound/about/>`__. *Older prototype versions
can be downloaded* `here
<https://www.nlnetlabs.nl/downloads/unbound/proto-java>`_.
<https://www.nlnetlabs.nl/downloads/unbound/proto-java>`__.

Unbound is a project to develop independent open-source DNS software and
documentation. It is jointly funded by `VeriSign, Inc.
Expand Down
6 changes: 3 additions & 3 deletions source/topics/filtering/rpz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ policies from external sources.
To get these external sources to work manually, you have to fetch the external
policies in the offered format, reformat it in such a way that Unbound will
understand, and keep this list up-to-date, for example using
:doc:`/manpages/unbound-control`.
:manpage:`unbound-control(8)`.

To automate this process in a generic, standardised way, Response Policy Zones
(RPZ) is a policy format that will work on different resolver implementations,
Expand Down Expand Up @@ -199,7 +199,7 @@ How to use RPZ with Unbound
The RPZ implementation in Unbound depends on the ``respip`` module, this module
needs to be loaded using ``module-config``. Each policy zone is configured in
Unbound using the ``rpz`` clause. The full documentation for RPZ in Unbound can
be found in the :doc:`manpages/unbound.conf`. A minimal configuration
be found in the :manpage:`unbound.conf(5)`. A minimal configuration
with a single policy zone can look like, where additional elements can be
uncommented:

Expand Down Expand Up @@ -390,7 +390,7 @@ zones.
:term:`define-tag<define-tag: <"list of tags">>`,
:term:`access-control-tag<access-control-tag: <IP netblock> <"list
of tags">>`, and :term:`extended-statistics<extended-statistics:
<yes or no>>` in the :doc:`/manpages/unbound.conf` manpage.
<yes or no>>` in the :manpage:`unbound.conf(5)` manpage.



Expand Down
48 changes: 24 additions & 24 deletions source/topics/privacy/dns-over-https.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ DNS-over-TLS (DoT) makes it possible to encrypt DNS messages and gives a DNS
client the possibility to authenticate a resolver. As implied by the name, this
is done by sending DNS messages over TLS. Unbound can handle TLS encrypted DNS
messages since `2011
<https://github.com/NLnetLabs/unbound/commit/aa0536dcb5846206d016a03d8d66ad4279247d9e>`_,
<https://github.com/NLnetLabs/unbound/commit/aa0536dcb5846206d016a03d8d66ad4279247d9e>`__,
long before the IETF DPRIVE working group started its work on the `DoT
specification <https://tools.ietf.org/html/rfc7858>`_.
specification <https://tools.ietf.org/html/rfc7858>`__.

There are, however, DNS clients that do not support DoT but are able to use
DNS-over-HTTPS (DoH) instead. Where DoT sends a DNS message directly over TLS,
DoH has an HTTP layer in between. Where DoT uses its own TCP port (853), DoH
uses the standard HTTPS port (443).
uses the standard HTTPS port (443).

By adding downstream DoH support to Unbound we hope to increase the ratio of
encrypted DNS traffic and increase the number of resolvers that offer encrypted
Expand All @@ -30,7 +30,7 @@ DoT. The HTTP/2 capability is negotiated using Application-Layer Protocol
Negotiation (ALPN) TLS extension, which is supported in OpenSSL from version
1.0.2 onward.

Unbound uses the `nghttp2 <https://nghttp2.org/>`_ library to handle the HTTP/2
Unbound uses the `nghttp2 <https://nghttp2.org/>`__ library to handle the HTTP/2
framing layer. This library does not take care of any I/O handling, which makes
it possible to easily integrate it in the existing Unbound event loop and TCP
handling. Adding HTTP/2 on top of the existing TCP code makes it possible to
Expand All @@ -56,46 +56,46 @@ an RST_STREAM frame. The HTTP status codes that can be returned by Unbound are:

404 Not Found
The request is directed to a path other than the configured endpoint in
http-endpoint (default /dns-query).
http-endpoint (default /dns-query).

413 Payload Too Large
The payload received in the POST request is too large. Payloads cannot be
larger than the content-length communicated in the request header. The
payload length is limited to 512 bytes if harden-large-queries is enabled,
and otherwise limited to the value configured in msg-buffer-size (default
larger than the content-length communicated in the request header. The
payload length is limited to 512 bytes if harden-large-queries is enabled,
and otherwise limited to the value configured in msg-buffer-size (default
65552 bytes). To prevent the allocation of overly large buffers, the maximum
size is limited to the size of the first DATA frame if no content-length is
received in the request.
received in the request.

414 URI Too Long
The base64url encoded DNS query in the GET request is too large. The DNS
The base64url encoded DNS query in the GET request is too large. The DNS
query length is limited to 512 bytes if harden-large-queries is enabled, and
limited to msg-buffer-size otherwise.
limited to msg-buffer-size otherwise.

415 Unsupported Media Type
The media type of the request is not supported. This happens if the request
contains a content-type header that is set to anything but
contains a content-type header that is set to anything but
application/dns-message. Requests without content-type will be treated as
application/dns-message.
application/dns-message.

400 Bad Request
No valid query received, not matched by any of the above 4xx status
codes.
codes.

501 Not Implemented
The method used in the request is not GET or POST.
The method used in the request is not GET or POST.

Using DoH
---------

As mentioned above, the `nghttp2 <https://nghttp2.org/>`_library is required to use Unbound’s DoH
As mentioned above, the `nghttp2 <https://nghttp2.org/>`__ library is required to use Unbound’s DoH
functionality. Compiling and installing Unbound with libnghttp2 can be done
using:

.. code-block:: bash
./configure --with-libnghttp2
make && make install
make && make install
Enabling DoH in Unbound is as simple as configuring the TLS certificate and the
corresponding private key that will be used for the connection, and configuring
Expand All @@ -116,7 +116,7 @@ is */dns-query*:

.. code-block:: text
$ ./dohclient -s 127.0.0.1 nlnetlabs.nl AAAA IN
$ ./dohclient -s 127.0.0.1 nlnetlabs.nl AAAA IN
Request headers
:method: GET
:path: /dns-query?dns=AAABAAABAAAAAAABCW5sbmV0bGFicwJubAAAHAABAAApEAAAAIAAAAA
Expand All @@ -126,7 +126,7 @@ is */dns-query*:
:status 200
content-type application/dns-message
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 0
;; flags: qr rd ra ad ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; flags: qr rd ra ad ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
nlnetlabs.nl. IN AAAA
Expand Down Expand Up @@ -167,4 +167,4 @@ Metrics
Three DoH related metrics are available in Unbound; ``num.query.https`` counts
the number of queries that have been serviced using DoH. The
``mem.http.query_buffer``, and ``mem.http.response_buffer`` counters keep track
of the memory used for the DoH query- and response buffers.
of the memory used for the DoH query- and response buffers.

0 comments on commit bbb20ca

Please sign in to comment.