dnstt-client.1 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. .\" https://man.openbsd.org/mdoc.7
  2. .Dd 2020-08-30
  3. .Dt DNSTT-CLIENT 1
  4. .Os
  5. .Sh NAME
  6. .Nm dnstt-client
  7. .Nd DNS tunnel client
  8. .Sh SYNOPSIS
  9. .Nm
  10. .Op Fl doh Ar URL | Fl dot Ar HOST : Ns Ar PORT | Fl udp Ar HOST : Ns Ar PORT
  11. .Op Fl pubkey Ar HEX | Fl pubkey-file Ar FILENAME
  12. .Ar DOMAIN
  13. .Ar LOCALADDR : Ns Ar LOCALPORT
  14. .Sh DESCRIPTION
  15. .Nm
  16. is the client portion of a DNS tunnel.
  17. It receives TCP connections at
  18. .Ar LOCALADDR : Ns Ar LOCALPORT
  19. and forwards them,
  20. encoded as a sequence of DNS messages
  21. and via a recursive resolver,
  22. to an instance of
  23. .Xr dnstt-server 1
  24. running as the authoritative name server for
  25. .Ar DOMAIN .
  26. The DNS messages may be carried over
  27. DNS over HTTPS,
  28. DNS over TLS,
  29. or classical DNS over UDP.
  30. .Pp
  31. You must use exactly one of the
  32. .Fl doh ,
  33. .Fl dot ,
  34. or
  35. .Fl udp
  36. options,
  37. to specify what form of DNS to use:
  38. .Bl -tag
  39. .It Fl doh Ar URL
  40. Use DNS over HTTPS.
  41. .Ar URL
  42. is the URL of the DNS over HTTPS resolver,
  43. including the
  44. .Ql /dns-query
  45. path if used by the resolver.
  46. .Pp
  47. See
  48. .Lk https://github.com/curl/curl/wiki/DNS-over-HTTPS#publicly-available-servers
  49. for a list of public DNS over HTTPS resolvers.
  50. .It Fl dot Ar HOST : Ns Ar PORT
  51. Use DNS over TLS.
  52. .Ar HOST
  53. and
  54. .Ar PORT
  55. are the TCP address of the DNS over TLS resolver.
  56. .Ar PORT
  57. is normally 853.
  58. .Pp
  59. See
  60. .Lk https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Public+Resolvers#DNSPrivacyPublicResolvers-DNS-over-TLS%28DoT%29
  61. for a list of public DNS over TLS resolvers.
  62. .It Fl udp Ar HOST : Ns Ar PORT
  63. Use DNS over UDP.
  64. .Ar HOST
  65. and
  66. .Ar PORT
  67. are the UDP address of the DNS resolver.
  68. .Ar PORT
  69. is normally 53.
  70. With
  71. .Fl udp ,
  72. you have the option of communicating directly with an instance of
  73. .Xr dnstt-server 1 ,
  74. without going through a recursive resolver.
  75. That is,
  76. .Ar HOST : Ns Ar PORT
  77. may point directly at the authoritative name server for
  78. .Ar DOMAIN ,
  79. where
  80. .Xr dnstt-server 1
  81. is running.
  82. .El
  83. .Pp
  84. In addition, you must use one of the
  85. .Fl pubkey
  86. or
  87. .Fl pubkey-file
  88. options to specify the public key used
  89. for authenticating the server and encrypting the channel.
  90. The public key should have been generated by
  91. .Ql dnstt-server -gen-key .
  92. .Xr dnstt-server 1
  93. prints its public key at the beginning of its log output.
  94. .Bl -tag
  95. .It Fl pubkey Ar HEX
  96. .Ar HEX
  97. is a string of 64 hexadecimal digits.
  98. .It Fl pubkey-file Ar FILENAME
  99. .Ar FILENAME
  100. is the name of a file containing
  101. 64 hexadecimal digits and an
  102. optional training newline character.
  103. .El
  104. .Sh EXAMPLES
  105. Tunnel through the DNS over HTTPS resolver at
  106. .Cm https://resolver.example/dns-query
  107. to the authoritative name server for
  108. .Cm t.example.com .
  109. Listen locally at
  110. .Cm 127.0.0.1:7000
  111. for connections to forward through the tunnel.
  112. Use the server public key stored in the file
  113. .Cm server.pub .
  114. .Bd -literal -offset indent
  115. dnstt-client -doh https://resolver.example/dns-query -pubkey-file server.pub t.example.com 127.0.0.1:7000
  116. .Ed
  117. .Pp
  118. Tunnel through the DNS over TLS resolver at
  119. .Cm resolver.example:853
  120. to the authoritative name server for
  121. .Cm t.example.com .
  122. Listen locally at
  123. .Cm 127.0.0.1:7000
  124. for connections to forward through the tunnel.
  125. Use the given hex string as the server public key.
  126. .Bd -literal -offset indent
  127. dnstt-client -dot resolver.example:853 -pubkey 14ca15f53660e248d289d9302f992c4bee518f2361d6343dafa7b417b5a3d752 t.example.com 127.0.0.1:7000
  128. .Ed
  129. .Sh DIAGNOSTICS
  130. .Nm
  131. writes running logs to standard error.
  132. At startup,
  133. .Nm
  134. logs the amount of useful payload capacity that can be stored
  135. in each DNS query, after accounting for the overhead of encoding.
  136. This number will vary depending on the length of
  137. .Ar DOMAIN .
  138. .Dl effective MTU 128
  139. .Sh BUGS
  140. .Nm
  141. has a distinctive TLS fingerprint
  142. and is probably easy to block on that basis.
  143. .Sh SECURITY CONSIDERATIONS
  144. The
  145. .Fl udp
  146. option is not covert,
  147. and is intended for debugging and special configurations.
  148. Only the
  149. .Fl doh
  150. and
  151. .Fl dot
  152. modes provide protection against detection of the tunnel,
  153. because they encrypt DNS messages between
  154. .Nm
  155. and the recursive resolver.
  156. The
  157. .Fl udp
  158. mode sends plaintext DNS messages,
  159. which reveal the use of a DNS tunnel by their special format.
  160. Even with
  161. .Fl doh
  162. or
  163. .Fl dot ,
  164. it may be possible for an observer to infer
  165. the use of a tunnel
  166. by traffic metadata features such as
  167. traffic volume and timing.
  168. The recursive resolver can see the plaintext of DNS messages
  169. and is always in a position to easily detect the use of a tunnel.
  170. But even if the use of a tunnel is detected, the
  171. .Em contents
  172. of the tunnel remain encrypted and authenticated.
  173. The end-to-end encryption and authentication of the tunnel is a separate layer,
  174. independent of the encryption
  175. provided by DNS over HTTPS or DNS over TLS.
  176. .Sh SEE ALSO
  177. .Xr dnstt-server 1
  178. .Lk https://www.bamsoftware.com/software/dnstt/
  179. .Sh AUTHORS
  180. .An David Fifield Aq Mt [email protected]