mirage / ocaml-dns

OCaml implementation of the DNS protocol
BSD 2-Clause "Simplified" License
105 stars 43 forks source link

TCP and EDNS #276

Closed orbitz closed 3 years ago

orbitz commented 3 years ago

I could not get ocaml-dns working on my laptop which is using unbound and after some debugging I believe the issue is that in Tcp mode, ocaml-dns always attaches an edns record, which unbound does not support. I flipped over to a UDP implementation and this was resolved. This was an issue for me because whatever the AWS ECS instances run has the same issue.

  1. Does what I have said make sense?
  2. If it does, how do you feel about being able to thread a "disable edns" option through when creating a client?
hannesm commented 3 years ago

that is a great suggestion, would https://github.com/mirage/ocaml-dns/pull/278/commits/4e3acd1936f7f5e1067202bfaea2f524ea454c1b suit your needs? (You can then pass ~edns:`None to create.

reynir commented 3 years ago

Commit c717141b3a662e5eccb58565d698b5e8959edbbc introduced adding edns-tcp-keepalive. I saw that unbound introduced support for edns-tcp-keepalive in 1.8.0 in September 2018. What do you observe when it doesn't work? Can you try and revert commit c717141b3a662e5eccb58565d698b5e8959edbbc and see if that changes anything for you?

orbitz commented 3 years ago

@hannesm This looks perfect, thank you!

orbitz commented 3 years ago

For more information, here is the TCP Dump I did using dns-client.unix on the current latest release of dns-client. The error is a "Format error" according to wireshark

https://www.dropbox.com/s/5e556fn5sqv9vwy/dns.log?dl=0

hannesm commented 3 years ago

part of 6.1.0 release