Skip to content

Cloudflare

We use Cloudflare to supply prod-friendly site domains and also to host our emails.

We currently manage 2 domains:

  • wdcc.co.nz - main site domain and also our email domain
  • wdccxsesahackathon.com - domain to host the WDCC x SESA hackathon site

Records

You can manage DNS records under the DNS tab (make sure you've selected the wdcc.co.nz domain).

All our site records are CNAME records, not A records.

Notable Records
- @ (wdcc.co.nz)                    - WDCC main website
- go.wdcc.co.nz                     - WDCC linktree
- docs.wdcc.co.nz                   - WDCC docs (this website)
- dashboard.wdcc.co.nz              - WDCC dashboard
- <project>.wdcc.co.nz              - projects production deployments
- <project>-staging.wdcc.co.nz      - projects staging deployments
- _acme-challenge.wdcc.co.nz        - used by fly to verify we own the domain
- MX records                        - used to manage our @wdcc.co.nz emails
- TXT records / _domainkey          - _acme-challenge equivalents for GCloud and other platforms

Setting up DNS using Cloudflare

Video: video (skip to ~4 minutes)

In terminal

Note: This uses flyctl

Due to cloudflare proxy, we need to allow cloudflare domain to access the fly machine. We do this by issuing certificates:

  1. In the terminal, run fly certs add <project-name>.wdcc.co.nz -a <app-name> (e.g. fly certs create ayo.wdcc.co.nz -a ayo-prod)
  2. Run fly certs setup <project-name>.wdcc.co.nz -a <app-name>. This will bring up a bunch of options.

We will use the A record with the Ownership TXT Record

On Cloudflare

  1. Log in to cloudflare with the tech account
  2. Choose Main account - it should Account Home page
  3. Click on the wdcc.co.nz domain and then go to DNS -> Records and then add the records:

Creating a new A record

  1. Select A for type
  2. For the name: use the abbreviation for your project (e.g. ayo - this will make the domain ayo.wdcc.co.nz)
  3. For the IPv4 address: use the one provided in the terminal after running fly certs setup
  4. Keep proxying on then save

Creating a new TXT record

  1. Select TXT for type
  2. For the name: use the one provided in the terminal starting with _fly-ownership
  3. For the content: use the one provided in the terminal following the arrow (usually start with app-)

You can check the status of the certificate using fly certs check <project-name>.wdcc.co.nz -a <app-name>