your_ip_to_ip
[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 WebPlaces = [web_place_default n]
14 with
15 config
16 end);
17
18 val web = webAt web_node;
19
20 val webAtIp =
21 \ ip : (your_ip) ->
22 \ host : (host) ->
23 \\ config : Vhost -> begin
24 dns (dnsA host (your_ip_to_ip ip));
25
26 vhost host where
27 WebPlaces = [web_place web_node ip]
28 with
29 config
30 end
31 end;
32
33 val addDefaultAlias = begin
34 mailbox <- Mailbox;
35 defaultAlias mailbox
36 end;
37
38 val addWww = begin
39 web "www" with
40 serverAliasDefault;
41 www : [Vhost] <- WWW;
42 www
43 end
44 end;
45
46 val domNoWwwNoDefaultAlias =
47 \ d : (your_domain) ->
48 \\ config : Domain ->
49 domain d with
50 dns (dnsNS "ns1.hcoop.net");
51 dns (dnsNS "ns3.hcoop.net");
52
53 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
54
55 handleMail;
56 dns (dnsMX 1 "deleuze.hcoop.net");
57
58 config
59 end;
60
61 val domNoDefaultAlias =
62 \ d : (your_domain) ->
63 \\ config : Domain ->
64 domNoWwwNoDefaultAlias d with
65 addWww;
66 config
67 end;
68
69 val domNoWww =
70 \ d : (your_domain) ->
71 \\ config : Domain ->
72 domNoWwwNoDefaultAlias d with
73 config;
74 addDefaultAlias;
75 end;
76
77 val dom =
78 \ d : (your_domain) ->
79 \\ config : Domain ->
80 domNoDefaultAlias d with
81 config;
82 addDefaultAlias;
83 end;
84
85 val nameserver = \host -> dns (dnsNS host);
86 val dnsIP = \from -> \to -> dns (dnsA from to);
87 val dnsMail = \num -> \host -> dns (dnsMX num host);
88 val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
89 val dnsDefault = \to -> dns (dnsDefaultA to);