samoht / ocaml-osx-dnssd

Binding to the macOS DNS-SD interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OCaml DNS Service Discovery for macOS

This library contains bindings to the functions in dns_sd.h, which are used to perform generic DNS queries using the macOS resolver. This is the best way to ensure that the query results match the results obtained by other apps on OSX.

Usage example

In a toplevel:

Dnssd.query "dave.recoil.org" Dns.Packet.Q_A;;
- : (Dns.Packet.rr list, Dnssd.error) result =
Ok
  [{Dns.Packet.name = <abstr>; cls = Dns.Packet.RR_IN; flush = false; ttl = 187l; rdata = Dns.Packet.A <abstr>};
   {Dns.Packet.name = <abstr>; cls = Dns.Packet.RR_IN; flush = false; ttl = 187l; rdata = Dns.Packet.CNAME <abstr>};
   {Dns.Packet.name = <abstr>; cls = Dns.Packet.RR_IN; flush = false; ttl = 187l; rdata = Dns.Packet.CNAME <abstr>}]

About

Binding to the macOS DNS-SD interface

License:ISC License


Languages

Language:OCaml 71.0%Language:C 28.4%Language:Makefile 0.6%