aef0232ee12c4ad1c6d0e1e5786d99882cfa60d2
[hcoop/domtool2.git] / lib / easy_domain.dtl
1 {{The most common kinds of domain configuration}}
2
3 val default_node : (node) = "mire";
4 val web_node : (web_node) = "mire";
5
6 val webAt =
7 \ n : (web_node) ->
8 \ host : (host) ->
9 \\ config : Vhost ->
10 (dns (dnsA host (ip_of_node (web_node_to_node n)));
11
12 vhost host where
13 WebNodes = [n]
14 with
15 config
16 end);
17
18 val web = webAt web_node;
19
20 val domNoDefaultAlias =
21 \ d : (your_domain) ->
22 \\ config : Domain ->
23 domain d with
24 dns (dnsNS "ns1.hcoop.net");
25 dns (dnsNS "ns3.hcoop.net");
26
27 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
28
29 handleMail;
30 dns (dnsMX 1 "deleuze.hcoop.net");
31
32 web "www" with
33 serverAliasDefault;
34 www : [Vhost] <- WWW;
35 www
36 end;
37
38 config
39 end;
40
41 val dom =
42 \ d : (your_domain) ->
43 \\ config : Domain ->
44 domNoDefaultAlias d with
45 config;
46 mailbox <- Mailbox;
47 defaultAlias mailbox;
48 end;
49
50 val nameserver = \host -> dns (dnsNS host);
51 val dnsIP = \from -> \to -> dns (dnsA from to);
52 val dnsMail = \num -> \host -> dns (dnsMX num host);
53 val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
54 val dnsDefault = \to -> dns (dnsDefaultA to);