GitHub Action to create, update and delete DNS records of MozOut Mozambique domains https://docs.mozout.co.mz
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-28 11:02:51 +02:00
.github Add CI workflow and Dependabot 2026-11-28 09:15:25 +02:00
__pycache__ Show the English README by default 2026-11-28 11:02:51 +02:00
action.yml Initial release (1.0.0) 2026-11-27 22:29:26 +02:00
CHANGELOG.md Initial release (1.0.0) 2026-11-27 22:29:26 +02:00
dns_update.py Initial release (1.0.0) 2026-11-27 22:29:26 +02:00
LICENSE Initial release (1.0.0) 2026-11-27 22:29:26 +02:00
README.md Show the English README by default 2026-11-28 11:02:51 +02:00
README_pt.md Show the English README by default 2026-11-28 11:02:51 +02:00
repo.json Use badges from the brand git 2026-11-28 10:59:29 +02:00

MozOut Mozambique DNS update

Release License: MIT

A GitHub Action that creates, changes or deletes DNS records of your MozOut Mozambique domain through the API. Use it to point a name to a new server after a deploy, to add a verification TXT, or to keep the zone in a repository.

Português

Before you start

Create an API key in the API Center of Meu MozOut with the dns:read and dns:write permissions, and save it in your repository as the secret MOZOUT_API_KEY. The domain must be active on your account with DNS on.

Example

.github/workflows/dns.yml:

name: DNS

on:
  workflow_dispatch:

jobs:
  dns:
    runs-on: ubuntu-latest
    steps:
      - name: Point www to the new server
        uses: mozout-mz/dns-update-action@v1
        with:
          api-key: ${{ secrets.MOZOUT_API_KEY }}
          domain: example.co.mz
          type: A
          name: www
          value: 203.0.113.10
          ttl: 3600

Several records in one step, as JSON:

      - uses: mozout-mz/dns-update-action@v1
        with:
          api-key: ${{ secrets.MOZOUT_API_KEY }}
          domain: example.co.mz
          records: |
            [
              {"type": "A", "name": "@", "value": "203.0.113.10"},
              {"type": "CNAME", "name": "blog", "value": "example.co.mz"},
              {"type": "TXT", "name": "@", "value": "site-verification=abc123"},
              {"action": "delete", "type": "A", "name": "old"}
            ]

What each action does

  • upsert (default): if the record already exists as asked, nothing changes. On A, AAAA and CNAME, a single record with the same name and type gets the new value. On MX, TXT, NS, SRV and CAA, a new value is added next to the others (an SPF and a verification code can live together). To change one of several records, give its current value in match-value.
  • create: always adds, unless the same record is already there.
  • delete: deletes the records with that name and type. With value, only the ones with that value. If there is nothing to delete, the step still passes.

Inputs

Input Default What it does
api-key API key with dns:read and dns:write. Empty uses the MOZOUT_API_KEY environment variable.
domain The domain (required).
action upsert upsert, create or delete.
type A, AAAA, CNAME, MX, TXT, NS, SRV or CAA.
name @ Record name, such as www. @ is the domain itself. The full name also works.
value Record value. SRV: weight port target. CAA: tag value.
ttl 60 to 604800 seconds. Empty keeps the current one, or 14400 on a new record.
priority For MX and SRV. On CAA it is the flag.
match-value Current value of the record to change, when there are several.
records Several records as a JSON list. When set, the inputs above are ignored.
dry-run false Show what would change, without changing.

Outputs: changed (true when something changed, or would change in a dry run), record-ids and simulated.

Good to know

  • A copy of the zone is kept before each change, and you can go back to it through the API.
  • With a sandbox_ key the changes are simulated: a safe way to try your workflow.
  • Read-only records, such as the NS records of the domain itself, are never touched. Nameservers are changed in the domain settings.
  • The MX records of the domain of the account email cannot be changed through the API. Change them in Meu MozOut.
  • Changes are limited to 20 per minute per account. Only the Python 3 already on the runner is used.
  • The API docs for DNS: https://docs.mozout.co.mz/dns/

License

MIT. See LICENSE.


Maintained by RLX Holdings.