Skip to content

Latest commit

 

History

History
216 lines (176 loc) · 5.16 KB

HOWTO.md

File metadata and controls

216 lines (176 loc) · 5.16 KB

How To

This section is a work in progress.

DNS Records

Our setup on Cloudflare supports the follow record types: (octoDNS docs)

A, AAAA, ALIAS, CAA, CNAME, MX, NS, PTR, SPF, SRV, TXT

You'll mostly wish to use these common types:

  • A: most common and basic (ipv4)
  • AAAA: same as A, but for ipv6
  • CNAME: domain name aliases. often used in custom domains for hosted services like GitHub Pages, Heroku, etc.
  • ALIAS: basically same as CNAME, but works for root domain
  • MX: used to setting up email addresses
  • TXT: holds arbitrary text data

Both A and CNAME records can be proxied with Cloudflare, if specified as below. (Cloudflare docs)

See the examples below to support in managing records.

(Note that either value or values can be used as key, but the latter expects an array.)

Examples

Adding an MX record to existing [sub]domain
diff --git a/g0v.ca./g0v.ca.yaml b/g0v.ca./g0v.ca.yaml
index 3050a90..474481e 100644
--- a/g0v.ca./g0v.ca.yaml
+++ b/g0v.ca./g0v.ca.yaml
@@ -15,3 +15,7 @@
       repository: https://github.com/ronnywang/301-service
       maintainer:
         - ronnywang
+  - type: MX
+    values:
+      - exchange: mx.example.com.
+        preference: 10
Add one more TXT record
diff --git a/g0v.ca./g0v.ca.yaml b/g0v.ca./g0v.ca.yaml
index 3050a90..2a62d42 100644
--- a/g0v.ca./g0v.ca.yaml
+++ b/g0v.ca./g0v.ca.yaml
@@ -6,6 +6,7 @@
       - admin=patcon
       # Used for 301 redirect service below
       - 301 https://g0v.tw/
+      - google-site-verification=1234-abcd-5678-EFGH
   - type: ALIAS
     value: 301.ronny.tw.
     octodns:
Create mysubdomain.g0v.ca with redirect to example.com
diff --git a/g0v.ca./mysubdomain.g0v.ca.yaml b/g0v.ca./mysubdomain.g0v.ca.yaml
new file mode 100644
index 0000000..7536024
--- /dev/null
+++ b/g0v.ca./mysubdomain.g0v.ca.yaml
@@ -0,0 +1,15 @@
+---
+mysubdomain:
+  - type: TXT
+    values:
+      # Used for 301 redirect service below
+      - 301 https://example.com/
+  - type: ALIAS
+    value: 301.ronny.tw.
+    octodns:
+      cloudflare:
+        proxied: true
+    metdata:
+      repository: https://github.com/ronnywang/301-service
+      maintainer:
+        - ronnywang
Create mysubdomain.g0v.ca and point to IP
diff --git a/g0v.ca./mysubdomain.g0v.ca.yaml b/g0v.ca./mysubdomain.g0v.ca.yaml
new file mode 100644
index 0000000..d079979
--- /dev/null
+++ b/g0v.ca./mysubdomain.g0v.ca.yaml
@@ -0,0 +1,11 @@
+---
+mysubdomain:
+  - type: A
+    octodns:
+      cloudflare:
+        proxied: true
+    value: 123.45.67.89
+    metdata:
+      repository: https://github.com/your-user/your-repo
+      maintainer:
+        - some-username
Delete subdomain oldapp.g0v.network
diff --git a/g0v.network./oldapp.g0v.network.yaml b/g0v.network./oldapp.g0v.network.yaml
deleted file mode 100644
index ed900a2..0000000
--- a/g0v.network./oldapp.g0v.network.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-oldapp:
-  type: CNAME
-  value: my-old-app.netlify.com.
-  metadata:
-    repo: https://github.com/g0v-network/my-old-app
-    maintainer:
-      - some-username

Subdomains

To add a new subdomain, just add an A or CNAME record as above, but for a new subdomain using a new config file.

Email Forwarders

Add a New Forwarder

#todo

Domains

Add a New Domain

Sample File Changes
diff --git a/README.md b/README.md
index b079994..8266139 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@ The following damains can be managed here:
 - `g0v.ca`
 - `c4nada.ca`
 - `t0ronto.ca`
+- `example.com`
 
 Changing or adding DNS records in `main` branch of this repository will update
 the actual domain records.
diff --git a/config.yaml b/config.yaml
index 3d10aed..c23c490 100644
--- a/config.yaml
+++ b/config.yaml
@@ -35,3 +35,8 @@ zones:
       - config-files
     targets:
       - cloudflare
+  example.com.:
+    sources:
+      - config-files
+    targets:
+      - cloudflare
diff --git a/example.com./example.com.yaml b/example.com./example.com.yaml
new file mode 100644
index 0000000..acedadd
--- /dev/null
+++ b/example.com./example.com.yaml
@@ -0,0 +1,6 @@
+---
+'':
+  - type: TXT
+    values:
+      # Who has admin for this domain
+      - admin=<some identifier of person who owns it>