lexicon(1)
π 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 oflexicon. vibe check, version edition β--delegated DELEGATEDβ specify the delegated domainPROVIDERβ 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 forupdateordeleteactions--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
- ubuntu resolute: lexicon 3.21.1-1 Β· MIT/Expat
- ubuntu stonking: lexicon 3.21.1-3 Β· MIT/Expat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms