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 domainwdccxsesahackathon.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:
- 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) - 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
- Log in to cloudflare with the tech account
- Choose Main account - it should Account Home page
- Click on the
wdcc.co.nzdomain and then go to DNS -> Records and then add the records:
Creating a new A record
- Select
Afor type - For the name: use the abbreviation for your project (e.g.
ayo- this will make the domainayo.wdcc.co.nz) - For the IPv4 address: use the one provided in the terminal after running
fly certs setup - Keep proxying on then save
Creating a new TXT record
- Select
TXTfor type - For the name: use the one provided in the terminal starting with
_fly-ownership - 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>