| CNAME of string * string
| MX of int * string
| NS of string
+ | DefaultA of string
val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) =>
(case (Env.string e1, Domain.ip e2) of
| _ => NONE)
| (EApp ((EVar "dnsNS", _), e), _) =>
Option.map NS (Env.string e)
+ | (EApp ((EVar "dnsDefaultA", _), e), _) =>
+ Option.map DefaultA (Env.string e)
| _ => NONE
fun writeRecord (evs, r) =
write "\tIN\tA\t";
write to;
write "\n")
+ | DefaultA to => (writeDom ();
+ write ".\t";
+ write (Int.toString ttl);
+ write "\tIN\tA\t";
+ write to;
+ write "\n")
| CNAME (from, to) => (write from;
write ".";
writeDom ();
write "\tIN\tCNAME\t";
write to;
write ".\n")
- | MX (num, host) => (write "\t";
+ | MX (num, host) => (writeDom ();
+ write ".\t";
write (Int.toString ttl);
write "\tIN\tMX\t";
write (Int.toString num);
write "\t";
write host;
write ".\n")
- | NS host => (write "\t";
+ | NS host => (writeDom ();
+ write ".\t";
write (Int.toString ttl);
write "\tIN\tNS\t";
write host;
fun dnsChanged () =
if #domain fs = !didDomain then
()
- else if #action fs = Slave.Delete then
+ else if Slave.isDelete (#action fs) then
let
val fname = OS.Path.joinBaseExt {base = #domain fs,
ext = SOME "zone"}
val () = Domain.registerResetLocal (fn () =>
ignore (OS.Process.system (Config.rm ^ " -rf /var/domtool/zones/*")))
+val () = Domain.registerDescriber (Domain.considerAll
+ [Domain.Filename {filename = "named.conf",
+ heading = "named.conf addition",
+ showEmpty = false},
+ Domain.Filename {filename = "dns",
+ heading = "DNS zonefile contents",
+ showEmpty = false}])
+
end