lexicon(1)

πŸ“¦
version 3.21.1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

lexicon β€” programmatically manipulate DNS records ✨

(also, heads up, this is a section 1 page, the User Commands one, so you already know it's a command you actually run in your terminal πŸ‘‘)


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay bestie, first thing's first, and I need you to sit down for this: the page literally says, and I am quoting here, "This manual documents the tldextract command."

Yes. It says tldextract. Not me, not my fault, I'm just the messenger πŸ’€


✨ SYNOPSIS ✨

usage: lexicon [-h] [--version] [--delegated DELEGATED] PROVIDER

πŸŽ€ OPTIONS πŸŽ€

  • -h, --help β€” shows this help message and then dips, iconic behaviour πŸ’…
  • --version β€” shows you the current version of lexicon. vibe check, version edition ⭐
  • --delegated DELEGATED β€” specify the delegated domain
  • PROVIDER β€” this is the one where you say which domain provider you want to create, update, delete or list DNS entries for, and your options are exactly: {cloudflare, cloudxns, digitalocean, dnsimple, dnsmadeeasy, dnspark, dnspod, easydns, luadns, namesilo, nsone, pointhq, rage4, route53, vultr, yandex, zonomi} 🌈 pick your fighter, there are seventeen of them and they're all invited to the party

🌸 PROVIDER USAGE 🌸

πŸ“œ SYNOPSIS πŸ“œ

lexicon PROVIDER [-h] [--name NAME] [--content CONTENT] [--ttl TTL]
[--priority PRIORITY] [--identifier IDENTIFIER] [--auth-username
AUTH_USERNAME] [--auth-token AUTH_TOKEN] ACTION DOMAIN TYPE

πŸ’œ OPTIONS πŸ’œ

  • PROVIDER β€” same deal as before, bestie: this specifies the domain provider you want to create, update, delete or list DNS entries for, from {cloudflare, cloudxns, digitalocean, dnsimple, dnsmadeeasy, dnspark, dnspod, easydns, luadns, namesilo, nsone, pointhq, rage4, route53, vultr, yandex, zonomi}. yes, the whole list again, they really wanted you to know 🫢
  • ACTION β€” specify the action to take, from {create, list, update, delete}
  • DOMAIN β€” specify the domain to use, and yes it supports subdomains as well, she's flexible like that πŸ’–
  • TYPE β€” specify the entry type, from {A, AAAA, CNAME, MX, NS, SPF, SOA, TXT, SRV, LOC}
  • -h, --help β€” print the provider-specific help message and exit (so, per-provider help, not the generic one, k? πŸŽ€)
  • --name NAME β€” specify the record name
  • --content CONTENT β€” specify the record content
  • --ttl TTL β€” specify the record time-to-live
  • --priority PRIORITY β€” specify the record priority
  • --identifier IDENTIFIER β€” specify the record for update or delete actions
  • --auth-username AUTH_USERNAME β€” specify email address used to authenticate
  • --auth-token AUTH_TOKEN β€” specify token used authenticate

πŸ”₯ EXAMPLES πŸ”₯

setup provider environmental variables:

LEXICON_CLOUDFLARE_USERNAME="myusername@example.com"
LEXICON_CLOUDFLARE_TOKEN="cloudflare-api-token"

list all TXT records on cloudflare

lexicon cloudflare list example.com TXT

create a new TXT record on cloudflare

lexicon cloudflare create www.example.com TXT
--name="_acme-challenge.www.example.com." --content="challenge
token"

delete a TXT record on cloudflare

lexicon cloudflare delete www.example.com TXT
--name="_acme-challenge.www.example.com." --content="challenge
token"

lexicon cloudflare delete www.example.com TXT
--identifier="cloudflare record id"

πŸ” AUTHENTICATION πŸ”

So most supported DNS services hand out an API token, but ngl every single service implements authentication its own way πŸ™ˆ. Lexicon tries to standardize auth around these CLI flags:

  • --auth-username β€” for DNS services that require it, this is usually the account id or email address
  • --auth-password β€” for DNS services that do not provide an API token, this is usually the account password
  • --auth-token β€” this is the most common auth method, the API token provided by the DNS service

You can see all the --auth-* flags for a specific service by reading the DNS-service-specific help:

lexicon cloudflare -h

Instead of providing authentication info via the CLI, you can also specify it via environmental variables ✨ Every DNS service and auth flag maps to an environmental variable like this:

LEXICON_{DNS Provider Name}_{Auth Type}

So instead of specifying --auth-username and --auth-token flags when calling the cli, you could instead set the LEXICON_CLOUDFLARE_USERNAME and LEXICON_CLOUDFLARE_TOKEN environmental variables. same energy, less typing, we love that for you 🫢


🧚 LETSENCRYPT INSTRUCTIONS 🧚

Lexicon has an example dehydrated hook file at examples/dehydrated.default.sh that you can use for any supported provider. All you need to do is set the PROVIDER env variable.

PROVIDER=cloudflare dehydrated --cron --hook
dehydrated.default.sh --challenge dns-01

Lexicon can also be used with Certbot (https://certbot.eff.org/) and the included Certbot hook file examples/certbot.default.sh β€” note that this one requires configuration ⚠️


🌈 SEE ALSO 🌈

For more information about lexicon see https://github.com/dns-lexicon/dns-lexicon. This manpage was created by Ana Custura for the Debian project πŸ’œ


okay that's the whole thing, you're officially certified in lexicon now, no cap πŸ‘‘

mwah, this was lexicon, dated February 2018 β€” catch you in the next section 1 page, bestie πŸ’‹πŸŽ€

πŸ“¦ where this page comes from