Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions rust/src/dns/guides/dns.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
summary: Manage DNS records with gddy — list, add, set, and delete
summary: Manage DNS records with gddy by listing, adding, setting, and deleting them
---

# Managing DNS with `gddy`
# Manage DNS with `gddy`

`gddy dns` manages a domain's DNS records with the following commands:

| Command | Destructive? | Purpose |
|---|---|---|
| `dns list` | No | List records, optionally filtered by type/name |
| `dns list` | No | List records, optionally filtered by type and name |
| `dns add` | No | Append new records |
| `dns set` | Yes | Replace every record for a type+name |
| `dns delete` | Yes | Remove every record for a type+name |

`NS` and `SOA` records are managed by GoDaddy and read-only — you can list them, but not add, set, or delete them.
`NS` and `SOA` records are managed by GoDaddy and read-only. You can list them, but not add, set, or delete them.

## Listing records
## List records

```
gddy dns list example.com
Expand All @@ -25,21 +25,21 @@ gddy dns list example.com --type A --name www

Without filters, `list` returns every record. `--type` narrows to one record type; `--name` further narrows to one name and requires `--type`.

## Adding records
## Add records

`add` appends new records without touching anything that already exists:

```
gddy dns add example.com --type A --name www --data 192.0.2.1 --ttl 3600
```

Pass `--data` more than once to add several records for the same type+name in one call — each becomes a separate record, and a failure on one doesn't stop the rest (the result reports created/failed counts with a per-value breakdown). `--ttl` defaults to 3600 seconds when omitted.
Pass `--data` more than once to add several records for the same type+name in one call. Each becomes a separate record, and a failure on one doesn't stop the rest. The result reports counts of created and failed records, with a per-value breakdown. `--ttl` defaults to 3600 seconds when omitted.

A name can hold a CNAME or other record types, never both. Adding into a name that already has the other kind fails with an error naming the conflict — see `set --replace-conflicting-types` below if you actually want to replace it.
A name can hold a CNAME or other record types, never both. Adding into a name that already has the other kind fails with an error naming the conflict. To replace it instead, use `set --replace-conflicting-types`, covered in the `set` section.

## Replacing records (`set`, destructive)
## Replace records (`set`, destructive)

`set` replaces every record matching a type+name pair with exactly the `--data` value(s) you give it. It reconciles rather than deleting and recreating everything: existing records are paired with your `--data` values, whatever's no longer in your list is deleted, and whatever's new is created. There's no atomic in-place replace in v3, so each paired value is written as a new record before the old one it's replacing is deleted — record IDs are not reused across a replace.
`set` replaces every record matching a type+name pair with exactly the `--data` value(s) you give it. It reconciles rather than deleting and recreating everything. It pairs existing records with your `--data` values, deletes whatever's no longer in your list, and creates whatever's new. There's no atomic in-place replace in v3, so `set` writes each paired value as a new record before it deletes the old one it replaces. Record IDs aren't reused across a replace.

```
gddy dns set example.com --type TXT --name @ --data "v=spf1 -all"
Expand All @@ -51,11 +51,11 @@ Preview the plan before writing:
gddy dns set example.com --type TXT --name @ --data "v=spf1 -all" --dry-run
```

The dry-run preview lists the planned action (replace/create/delete) per record so you can confirm it before it runs for real. `set` is not atomic — a partial failure reports how many records were replaced, created, and deleted before it happened.
The dry-run preview lists the planned action (replace, create, or delete) per record so you can confirm it before it runs for real. `set` isn't atomic. A partial failure reports how many records were replaced, created, and deleted before it happened.

To also remove a conflicting CNAME (or, when setting a CNAME, any other type) at that name, add `--replace-conflicting-types`.

## Deleting records
## Delete records

`delete` removes every record matching a type+name pair:

Expand All @@ -65,18 +65,18 @@ gddy dns delete example.com --type A --name www

Deleting something that doesn't match is a no-op success (`deleted: 0`), not an error. Preview with `--dry-run` first for anything you're not fully sure about.

For `SRV` and `TLSA` records, the name does not include the service or port: `--type SRV --name chat` matches every SRV record listed under `chat`, whatever its service, so `list` or `--dry-run` first to see which will be removed. To target one service, give the full name instead, e.g. `--name _sip._tcp.chat` (for `TLSA`, `_443._tcp.www`).
For `SRV` and `TLSA` records, the name doesn't include the service or port. `--type SRV --name chat` matches every SRV record listed under `chat`, whatever its service, so run `list` or `--dry-run` first to see which will be removed. To target one service, give the full name instead, for example `--name _sip._tcp.chat` (for `TLSA`, `_443._tcp.www`).

## International domain names

Domain names and record names can be typed either as Unicode (`münchen.de`) or in their encoded form (`xn--mnchen-3ya.de`); both reach the same domain. Output shows Unicode by default. Add `--punycode` to any DNS command to show the encoded form instead, or make that your default with `gddy config set punycode true` (undo it with `gddy config unset punycode`). Precedence is the `--punycode` flag, then the `GDDY_PUNYCODE` environment variable, then your saved setting, then Unicode, so `--punycode=false` turns the encoded form back off for one command. `gddy config list` shows the current value. Record values (the `--data` of a CNAME, MX or TXT record) are never converted; enter them exactly as they should be stored.

## Type-specific flags

Most of these only apply to certain record types — set them only when the type calls for it:
Most of these only apply to certain record types, so set them only when the type calls for it:

| Flag | Applies to | Notes |
|---|---|---|
| `--priority` | `MX`, `SRV` | |
| `--port`, `--weight`, `--protocol`, `--service` | `SRV` | |
| `--flag`, `--tag` | `CAA` | `--tag` is required for CAA (e.g. `issue`, `issuewild`, `iodef`); `--data` carries the CA domain/value |
| `--flag`, `--tag` | `CAA` | CAA records require `--tag` (for example `issue`, `issuewild`, `iodef`), and `--data` carries the value for that tag, for example a CA domain |
Loading