Swag cpanel dns keep getting Unable to find SOA record

first time using swag so please be kind.

so my setup:

  1. mydomain com - main server & dns running on cpanel hosting
  2. analytic mydomain com - on a debian 12 vps running docker and analytic app,

DNS from #1 “A” records point to #2 IP address. ssh can connect to the analytic domain.
Swag docker is running on #2
I have configured to VALIDATION=dns, set config/dns-conf/cpanel.ini with the correct credentials, url and API token (triple checked it).

But when i run swag, i keep getting Error adding TXT record: Unable to find SOA record

Any pointer / help would be appriciated.
thanks.

result of $:docker compose up

swag  | Linuxserver.io version: 3.3.0-ls370
swag  | Build-date: 2025-03-15T03:31:31+00:00
swag  | ───────────────────────────────────────
swag  |
swag  | using keys found in /config/keys
swag  | Variables set:
swag  | PUID=1000
swag  | PGID=100
swag  | TZ=utc/UTC
swag  | URL=mydomain.com
swag  | SUBDOMAINS=www.analytic,analytic
swag  | EXTRA_DOMAINS=
swag  | ONLY_SUBDOMAINS=true
swag  | VALIDATION=dns
swag  | CERTPROVIDER=
swag  | DNSPLUGIN=cpanel
swag  | EMAIL=
swag  | STAGING=false
swag  |
swag  | Using Let's Encrypt as the cert provider
swag  | SUBDOMAINS entered, processing
swag  | Sub-domains processed are: www.analytic.mydomain.com,analytic.mydomain.com
swag  | No e-mail address entered or address invalid
swag  | dns validation via cpanel plugin is selected
swag  | Generating new certificate
swag  | Saving debug log to /config/log/letsencrypt/letsencrypt.log
swag  | Requesting a certificate for www.analytic.mydomain.com and analytic.mydomain.com
swag  | Unsafe permissions on credentials configuration file: /config/dns-conf/cpanel.ini
swag  | /config/dns-conf/cpanel.ini: token and password are exclusive, token will be used when both are provided
swag  | Error adding TXT record: Unable to find SOA record.
swag  | Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /config/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
swag  | ERROR: Cert does not exist! Please see the validation error above. Make sure you entered correct credentials into the /config/dns-conf/cpanel.ini file.

letsencrypt.log

Note: All IP address and domain are masked. I uses PGID 100 cause multiple users need to access the folder

i would engage cpanel support, especially if you don’t see an SOA record, which certbot is telling you is missing.

Thanks for the info. i thought it was swag config error.

You pointed me in the right direction to troubleshoot.

this let me to

which is a similar issue.
the problem it seem from cpanel (bug?) so if you use their add subdomain function
their DNS API behave weirldy (unsure how)

why i did this? this is the only way to get email for the subdomain in cpanel.
how to solve it? see below.

hope this helps someone else.

TL:DR

  1. Delete the subdomain from the domain panel in cpanel.
  2. add subdomian manually using zone editor.
  3. run swag docker with the correct config

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.