txt with the /go/txt Command

TXT records hold text in DNS. Services use them to verify that you own a domain (Google, Microsoft, and others), to publish email policies, and to answer certificate challenges. /go/txt is a shortcut for adding one. It does no DNS work itself. It passes your arguments to cloudflare with the record type set to txt, and that command makes the change through Cloudflare's API. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# A TXT record for the domain itself
/go/txt example.com google-site-verification=abc123

# A TXT record at a chosen name
/go/txt example.com _acme-challenge Abc123Def456

Options

Argument Required Notes
<domain> Yes The domain to update. It must already be in Cloudflare.
<name> No The record name, for example _acme-challenge. Use a name relative to the domain.
<value> Yes The text of the record.

Arguments after the third are ignored.

[!IMPORTANT]
The script passes <value> on without quotes, so a value that contains spaces is split into several words, even if you quote it when you run the command. A value without spaces, such as a verification token, works as expected. For SPF, DKIM, and DMARC records, which contain spaces, use spf, dkim, and dmarc.

Examples

# Domain verification token on the domain itself
/go/txt example.com google-site-verification=abc123

# Microsoft 365 verification record
/go/txt example.com MS=ms12345678

# A challenge record at _acme-challenge.example.com
/go/txt example.com _acme-challenge Abc123Def456

Output

The command prints whatever cloudflare prints. It adds no output of its own. The exit status is the one returned by cloudflare.

Every run is logged to /var/log/go/txt.log with a timestamp and the arguments used.

See the full reference at /go/txt and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *