With this command you can generate a certificate signing request with the alternative names already in the CSR. If you want to add domain names use DNS:example.com, if you want to add IP address use this format: IP:127.0.1.1. You can add as many alternativa names as you wish, as separator use a comma.
In this example I used the config file made in this post.