xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/doth/README.curl (revision 8aaca124c0ad52af9550477f296b63debc7b4c98)
1<!--
2Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
4SPDX-License-Identifier: MPL-2.0
5
6This Source Code Form is subject to the terms of the Mozilla Public
7License, v. 2.0.  If a copy of the MPL was not distributed with this
8file, you can obtain one at https://mozilla.org/MPL/2.0/.
9
10See the COPYRIGHT file distributed with this work for additional
11information regarding copyright ownership.
12-->
13
14DoH query values that can be passed on the command line for testing
15with curl can be obtained by encoding binary DNS messages into
16base64url, with trailing '='s removed.
17
18For example:
19
20$ perl bin/tests/system/fromhex.pl << EOF | base64url
21    # Transaction ID
22    0001
23    # Standard query
24    0000
25    # Questions: 1, Additional: 0
26    0001 0000 0000 0000
27    # QNAME: example
28    07 6578616d706c65 00
29    # Type: SOA
30    0006
31    Class: IN
32    0001
33EOF
34
35This produces the string "AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE=". With
36the trailing '=' removed, this can then be passed to curl:
37
38curl "https://<server>/dns-query?dns=AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE"
39