1 .\" https://man.openbsd.org/mdoc.7
17 .Op Fl privkey-file Ar FILENAME
18 .Op Fl pubkey-file Ar FILENAME
21 .Fl udp Ar ADDR : Ns Ar PORT
22 .Op Fl privkey Ar HEX | Fl privkey-file Ar FILENAME
25 .Ar UPSTREAMADDR : Ns Ar UPSTREAMPORT
31 is the server portion of a DNS tunnel.
32 It receives DNS over UDP messages at
33 .Ar ADDR : Ns Ar PORT ,
34 decodes the streams they contain,
35 and forwards the streams as TCP connections to
36 .Ar UPSTREAMADDR : Ns Ar UPSTREAMPORT .
37 .Nm acts as the authoritative name server for
39 and communicates with an instance of
41 via a recursive resolver.
43 .Ss GENERATING A SERVER KEYPAIR
46 encrypts and authenticates the tunneled connection
47 using the server's public key.
48 To generate a server keypair, use the
55 options to save the generated private key,
62 Generate a server keypair.
64 .It Fl privkey-file Ar FILENAME
67 save the generated private key to
70 .It Fl pubkey-file Ar FILENAME
73 save the generated public key to
79 On the server, you only need to store the private key, because
81 can derive the public key from the private key.
82 The client only needs to have the server's public key
83 and should not know the servers private key.
85 .Ss RUNNING THE SERVER
89 option specifies the UDP address on which
91 listens for incoming DNS messages.
94 .It Fl udp Ar ADDR : Ns Ar PORT
95 Accept DNS messages at the given address.
98 when operating with a recursive intermediate resolver,
99 unless you have made some other provision for forwarding
106 Specify the server's persistent keypair using the
111 If you do not use one of these options,
113 generates a temporary keypair
114 and logs the public key to standard error.
118 .It Fl privkey Ar HEX
120 is a string of 64 hexadecimal digits.
122 .It Fl privkey-file Ar FILENAME
124 is the name of a file containing
125 64 hexadecimal digits and an
126 optional training newline character.
131 In some situations, you may have to use the
133 option to control the maximum UDP payload size.
138 Never send UDP payloads larger than
143 is 1232, but some recursive resolver only support a maximum of 512.
144 You will know you need to use the
146 option when you see messages like this on standard error:
147 .Dl FORMERR: requester payload size 512 is too small (minimum 1232)
155 Save the private key to the file
157 and the public key to
159 Next, you would typically copy
163 .Bd -literal -offset indent
164 dnstt-server -gen-key -privkey-file server.key -pubkey-file server.pub
168 Accept DNS messages at the UDP address
170 decode the streams contained therein,
171 and forward the streams as TCP connections to
173 Read the private key from the file
175 and derive the public key from it.
176 The server should be configured to be
177 the authoritative name server for the domain
180 .Bd -literal -offset indent
181 dnstt-server -udp 127.0.0.1:53 -privkey-file server.key t.example.com 127.0.0.1:8000
188 writes running logs to standard error.
193 This string can be used with the
198 .Dl pubkey 14ca15f53660e248d289d9302f992c4bee518f2361d6343dafa7b417b5a3d752
203 logs the amount of useful payload capacity that can be stored
204 in each DNS response, after accounting for the overhead of encoding.
205 This number will vary depending on the length of
210 .Dl effective MTU 932
214 If the recursive resolver's stated maximum UDP payload size
218 will log a message like this,
219 which tells you that you need to use the
223 .Dl FORMERR: requester payload size 512 is too small (minimum 1232)
230 .Lk https://www.bamsoftware.com/software/dnstt/
235 .An David Fifield Aq Mt david@bamsoftware.com