GitHub Action to create, update and delete DNS records of Interweb Angola domains
https://docs.interweb.ao
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| __pycache__ | ||
| action.yml | ||
| CHANGELOG.md | ||
| dns_update.py | ||
| LICENSE | ||
| README.md | ||
| README_pt.md | ||
| repo.json | ||
Interweb Angola DNS update
A GitHub Action that creates, changes or deletes DNS records of your Interweb Angola 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.
Before you start
Create an API key in the API Center of Meu Interweb with the dns:read and dns:write permissions, and save it in your repository as the secret INTERWEB_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: interweb-ao/dns-update-action@v1
with:
api-key: ${{ secrets.INTERWEB_API_KEY }}
domain: example.co.ao
type: A
name: www
value: 203.0.113.10
ttl: 3600
Several records in one step, as JSON:
- uses: interweb-ao/dns-update-action@v1
with:
api-key: ${{ secrets.INTERWEB_API_KEY }}
domain: example.co.ao
records: |
[
{"type": "A", "name": "@", "value": "203.0.113.10"},
{"type": "CNAME", "name": "blog", "value": "example.co.ao"},
{"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 INTERWEB_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 Interweb.
- 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.interweb.ao/dns/
License
MIT. See LICENSE.
Maintained by RLX Holdings.