your_ip_to_ip
[hcoop/domtool2.git] / lib / easy_domain.dtl
CommitLineData
6bb366c5
AC
1{{The most common kinds of domain configuration}}
2
6eeb3bf9 3val default_node : (node) = "mire";
60695e99 4val web_node : (web_node) = "mire";
15e529d6
AC
5
6val webAt =
60695e99 7 \ n : (web_node) ->
15e529d6
AC
8 \ host : (host) ->
9 \\ config : Vhost ->
60695e99 10 (dns (dnsA host (ip_of_node (web_node_to_node n)));
15e529d6
AC
11
12 vhost host where
b5f2d506 13 WebPlaces = [web_place_default n]
15e529d6
AC
14 with
15 config
16 end);
17
18val web = webAt web_node;
6bb366c5 19
2e87719c
AC
20val 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
d4e42f2a
AC
33val addDefaultAlias = begin
34 mailbox <- Mailbox;
35 defaultAlias mailbox
36end;
37
38val addWww = begin
39 web "www" with
40 serverAliasDefault;
41 www : [Vhost] <- WWW;
42 www
43 end
44end;
45
46val domNoWwwNoDefaultAlias =
6bb366c5
AC
47 \ d : (your_domain) ->
48 \\ config : Domain ->
49 domain d with
94b7b11a
AC
50 dns (dnsNS "ns1.hcoop.net");
51 dns (dnsNS "ns3.hcoop.net");
6bb366c5 52
16465a9a 53 dns (dnsDefaultA (ip_of_node (web_node_to_node web_node)));
6eeb3bf9 54
6bb366c5 55 handleMail;
1c5aa57d 56 dns (dnsMX 1 "deleuze.hcoop.net");
6bb366c5 57
6bb366c5
AC
58 config
59 end;
8c142ff5 60
d4e42f2a
AC
61val domNoDefaultAlias =
62 \ d : (your_domain) ->
63 \\ config : Domain ->
64 domNoWwwNoDefaultAlias d with
65 addWww;
66 config
67 end;
68
69val domNoWww =
70 \ d : (your_domain) ->
71 \\ config : Domain ->
72 domNoWwwNoDefaultAlias d with
73 config;
74 addDefaultAlias;
75 end;
76
6b718954
AC
77val dom =
78 \ d : (your_domain) ->
79 \\ config : Domain ->
80 domNoDefaultAlias d with
81 config;
d4e42f2a 82 addDefaultAlias;
6b718954
AC
83 end;
84
8c142ff5
AC
85val nameserver = \host -> dns (dnsNS host);
86val dnsIP = \from -> \to -> dns (dnsA from to);
87val dnsMail = \num -> \host -> dns (dnsMX num host);
88val dnsAlias = \from -> \to -> dns (dnsCNAME from to);
eda33894 89val dnsDefault = \to -> dns (dnsDefaultA to);