Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns-client: the uncensoreddns only provides service via TLS #320

Merged
merged 1 commit into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -138,10 +138,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