ocaml-dns
ocaml-dns copied to clipboard
Should Ptr.t use raw domain names?
Currently, Ptr.t has type [ 'host ] Domain_name.t, but I think that the PTR data is supposed to be domain names. The hostname validation breaks DNS-SD where PTR targets contain spaces:
_hap._tcp.local. PTR My Device._hap._tcp.local.
Cname.t is already [ 'raw ]. Ptr and I suspect we should do the same for PTR:
module Ptr = struct
type t = [ `raw ] Domain_name.t
let decode names buf ~off ~len:_ = Name.decode names buf ~off
end
Users can call Domain_name.host explicitly if they need hostname validation.
Indeed that may be sensible. May I ask what kind of service you're using ocaml-dns with dns-sd, resolver, client, or server?
I'm using it on the client side, for the homekit (hap) and matter protocols.