Several domains -> 1 Virtual host : CNAME or ServerAlias ?

I have some virtual hosts / domains On 1 Droplet and need to bind several domans to 1 of vhosts

Let it be

I see 2 options:

Add to /DNS menu domain with CNAME records: CNAME CNAME

and also add to /DNS domains and just with A records

and set digitalocean nameservers to domain names

Add to /DNS domains ,, with A records

In httpd.conf:

<VirtualHost *.80> ServerName ServerAlias ServerAlias </VirtualHost>

Is it correct? What would be better?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello, <br> <br>Option 1 will only work if your website is being served without name based virtual hosting (browse your site using its IP address; if you can see your site, it is name based virtual hosting and therefore this will work). <br> <br>Option 2 will work fine in case you are using name based virtual hosting. <br> <br>However, please note that you can not set CNAME on root domain ( CNAME to, but only for its hostnames.