Requesting a certificate for more than one name used to mean editing an openssl.cnf. Since OpenSSL 1.1.1, -addext does it on the command line.
Make a key and a certificate signing request in two steps:
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -out site.key
openssl req -new -key site.key \
-subj "/CN=nas.example.com" \
-addext "subjectAltName=DNS:nas.example.com,DNS:www.example.com,IP:192.0.2.10" \
-out site.csr
The -subj sets the subject, so OpenSSL does not ask questions, and -addext adds the SAN list. Several names go in one comma separated value, and IP addresses take the IP: prefix.
Check the result before you send it anywhere:
openssl req -in site.csr -noout -text | grep -A1 'Alternative'
I find this handy for a private CA or for a provider that still wants a CSR pasted into a web form. Public CAs validate every name in the list, so only add names you control.
A CA does not have to copy your extensions. Some take only the names you type in their form, and a private CA signing with openssl x509 -req drops them unless told to copy them. So check the issued certificate too, not just the request. Keep site.key private; the CSR is the only file that leaves your machine.
Further reading: OpenSSL: openssl-req
Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get