HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add default DNS mappings
[hcoop/domtool2.git]
/
src
/
plugins
/
bind.sml
diff --git
a/src/plugins/bind.sml
b/src/plugins/bind.sml
index
5ba7fed
..
b6a07b6
100644
(file)
--- a/
src/plugins/bind.sml
+++ b/
src/plugins/bind.sml
@@
-49,6
+49,7
@@
datatype dns_record =
| CNAME of string * string
| MX of int * string
| NS of string
| 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
val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) =>
(case (Env.string e1, Domain.ip e2) of
@@
-64,6
+65,8
@@
val record = fn (EApp ((EApp ((EVar "dnsA", _), e1), _), e2), _) =>
| _ => NONE)
| (EApp ((EVar "dnsNS", _), e), _) =>
Option.map NS (Env.string e)
| _ => 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) =
| _ => NONE
fun writeRecord (evs, r) =
@@
-84,6
+87,12
@@
fun writeRecord (evs, r) =
write "\tIN\tA\t";
write to;
write "\n")
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 ();
| CNAME (from, to) => (write from;
write ".";
writeDom ();