Name of the certificate

I generated certificate for few domains and it got stored (symlinked) into /etc/letsencrypt/live/the-first-domain.tld/*. Later I regenerated this certificate and added few more domains and it got stored to /etc/letsencrypt/live/the-first-domain.tld-0001/*. I expected that the certificate is named after it’s first domain, but it looks like there is more logic behind.

I use this command: letsencypt ... -d first-domain -d second-domain -d third... stored in bash script to get the certificate for all domains I have (with few subdomains).

How can I specify the name of the certificate, so it won’t be changed?

I guess you found the answer already by now - i.e. to use the --expand flag (and this flag is assumed by default when using --renew-by-default).

It may be of interest to you that I started a topic about the same issue, but when removing domains instead of adding them.