Skip to content

Commit

Permalink
Merge pull request #320 from hannesm/uncensored-only-tls
Browse files Browse the repository at this point in the history
dns-client: the uncensoreddns only provides service via TLS
  • Loading branch information
hannesm authored Oct 5, 2022
2 parents b7be3de + 7828f05 commit 17fca4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions lwt/client/dns_client_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ module Transport : Dns_client.S
let authenticator = authenticator () in
let peer_name = Dns_client.default_resolver_hostname in
let tls_config = Tls.Config.client ~authenticator ~peer_name () in
List.flatten
(List.map (fun ip -> [
`Tls (tls_config, ip, 853); `Plaintext (ip, 53)
]) Dns_client.default_resolvers)
List.map (fun ip -> `Tls (tls_config, ip, 853)) Dns_client.default_resolvers

let maybe_resolv_conf t =
match t.nameservers with
Expand Down
6 changes: 2 additions & 4 deletions mirage/client/dns_client_mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ module Make (R : Mirage_random.S) (T : Mirage_time.S) (M : Mirage_clock.MCLOCK)
let peer_name = Dns_client.default_resolver_hostname in
Tls.Config.client ~authenticator ~peer_name ()
in
List.flatten
(List.map
(fun ip -> [ `Tls (tls_cfg, ip, 853) ; `Plaintext (ip, 53) ])
Dns_client.default_resolvers)
List.map (fun ip -> `Tls (tls_cfg, ip, 853))
Dns_client.default_resolvers
| Some (`Udp, _) -> invalid_arg "UDP is not supported"
| Some (`Tcp, ns) -> ns
in
Expand Down
3 changes: 1 addition & 2 deletions unix/client/dns_client_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ module Transport : Dns_client.S
| Ok ips -> Ok ips
| Error _ as e -> e

let default_resolvers () =
List.map (fun ip -> ip, 53) Dns_client.default_resolvers
let default_resolvers () = [ Ipaddr.of_string_exn "1.1.1.1", 53 ]

let maybe_resolv_conf t =
match t.nameservers with
Expand Down

0 comments on commit 17fca4a

Please sign in to comment.