1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
| | ;;; GNU Guix system administration tools.
;;;
;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation, either version 3 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(define-module (sysadmin dns)
#:use-module (gnu services knot)
#:export (guix.gnu.org-zone
berlin-ip4
bayfront-ip4))
;;; Commentary:
;;;
;;; DNS configuration.
;;;
;;; For any change in the zone (an IP, a new record, ...), increment the
;;; the serial in the zone configuration. This is very important for
;;; changes to be taken into account.
;;;
;;; Remember some DNS rules: no other kind of record for a CNAME record.
;;; Always associate a name that resolves to an A or an AAAA record
;;; immediately (it cannot be a CNAME). Same for MX.
;;;
;;; Remember that data is relative to the root of this zone when it
;;; reference another domain name, unless it ends with a dot.
;;;
;;; Ex: "ns1.guix.gnu.org" actually means "ns1.guix.gnu.org.guix.gnu.org"
;;; whereas "ns1.guix.gnu.org." means what it says.
;;;
;;; Code:
;; Define some IP addresses for easier use later
(define gnu.org-ip4 "209.51.188.148")
(define gnu.org-ip6 "2001:470:142:3::a")
(define hydra-ip4 "18.4.89.46")
(define bayfront-ip4 "185.233.100.56")
(define berlin-ip4 "141.80.181.40")
(define-zone-entries guix.gnu.org.zone
;; Name TTL Class Type Data
("@" "" "IN" "A" gnu.org-ip4)
("@" "" "IN" "AAAA" gnu.org-ip6)
("@" "" "IN" "NS" "ns1")
("@" "" "IN" "NS" "ns2")
("ns1" "" "IN" "A" bayfront-ip4)
("ns2" "" "IN" "A" berlin-ip4)
("hydra" "" "IN" "A" hydra-ip4)
("berlin" "" "IN" "A" berlin-ip4)
("bayfront" "" "IN" "A" bayfront-ip4)
("ci" "" "IN" "CNAME" "berlin"))
(define guix.gnu.org-zone
(knot-zone-configuration
(domain "guix.gnu.org")
(zone (zone-file
(origin "guix.gnu.org")
(entries guix.gnu.org.zone)
(serial 1)))))
|