Mriyam's DNS entries using GitHub Actions. Inspired from this article
Modify the YAML file for the zone you'd like to update. The top-level key is the subdomain value, and its value is a Hash/Dictionary of values.
For more details, check here - Records Documentation
Note:
- Auto TTL on Cloudflare equals 300 seconds
- For proxied records, Cloudflare manages TTL, so the value doesn't apply
From the root of the repo, run
docker run --rm -it \
--env CLOUDFLARE_EMAIL="$CLOUDFLARE_EMAIL" \
--env CLOUDFLARE_TOKEN="$CLOUDFLARE_TOKEN" \
--volume $PWD/config:/config \
parkr/octodns:v0.9.5 \
octodns-sync --config-file ./config/production.yaml
If you want to actually make the change, just add --doit
at the end.
docker run --rm -it \
--env CLOUDFLARE_EMAIL="$CLOUDFLARE_EMAIL" \
--env CLOUDFLARE_TOKEN="$CLOUDFLARE_TOKEN" \
--volume $PWD/config:/config \
parkr/octodns:v0.9.5 \
octodns-sync --config-file ./config/production.yaml --doit
Assuming the domain is on cloudflare, you need to run this from the root of the repo.
docker run --rm -it \
--env CLOUDFLARE_EMAIL="$CLOUDFLARE_EMAIL" \
--env CLOUDFLARE_TOKEN="$CLOUDFLARE_TOKEN" \
-v $(pwd):/opt/dns \
parkr/octodns:v0.9.5 \
octodns-dump \
--config-file /opt/dns/config/production.yaml \
--output-dir /opt/dns/config \
"example.com." \
cloudflare
Example records
- A record with minimum TTL.
mail: ttl: 120 type: A value: 1.1.1.1
- A record with TTL equivalent to
auto
TTL.blog: ttl: 300 type: A value: 1.1.1.1
- CNAME record with Cloudflare Proxy disabled
www: octodns: cloudflare: proxied: false ttl: 3600 type: CNAME value: mbtest.ga.
- Create a new branch and check it out.
- Modify a record and commit the changes.
- Push the changes and submit a PR.
- GitHub Actions runs
octodns-sync
to generate plan. - Verify the records in the output of the dry run and merge the PR.
- GitHub Actions runs
octodns-sync --doit
to apply the plan.