README.curl
1 <!--
2 Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
4 SPDX-License-Identifier: MPL-2.0
5
6 This Source Code Form is subject to the terms of the Mozilla Public
7 License, v. 2.0. If a copy of the MPL was not distributed with this
8 file, you can obtain one at https://mozilla.org/MPL/2.0/.
9
10 See the COPYRIGHT file distributed with this work for additional
11 information regarding copyright ownership.
12 -->
13
14 DoH query values that can be passed on the command line for testing
15 with curl can be obtained by encoding binary DNS messages into
16 base64url, with trailing '='s removed.
17
18 For 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
33 EOF
34
35 This produces the string "AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE=". With
36 the trailing '=' removed, this can then be passed to curl:
37
38 curl "https://<server>/dns-query?dns=AAEAAAABAAAAAAAAB2V4YW1wbGUAAAbFrMonAAE"
39