How do I add another domain to my Linode?

Linode Staff

We're currently hosting on our Linode server, but we would like to add and to our Linode as well.

1 Reply

There are a few steps you need to take in order to add additional domains to your Linode.

First, you will want to create A records for either your new domain or for your subdomain and point it to your Linode's IP address. Alternatively, you can create CNAME records and point it to your domain name that is currently hosted on your Linode.

If you are using the Linode DNS Manager, you can review how to add/create DNS records in this article here.


Once you've pointed the domain correctly to your Linode, you want to set up what is called a Name-Based Virtual Host. A name-based virtual host is a way for your web server to respond with different resources based on the domain name that was used when trying to access the server.

The instructions for setting up a virtual host will vary depending on the web server you use. Most people use one of the following:

For each virtual host, you would want to set a web server root directory. Most default configurations set it to something like /var/www/html/. A common configuration to separate into virtual hosts would be to create subdirectories as follows:

  • /var/www/html/
  • /var/www/html/
  • /var/www/html/

(please note you will need to create the directories yourself using the mkdir command)


Once you've completed that and correctly configured your name-based virtual hosts, you should be good to go! Your web server should now return different content based on the domain name you accessed it with.


Bonus: Sometimes, you want to redirect from one virtual host to another. This is useful if you want to force a redirect from http to https, or if you want to force to redirect to This can be done with Redirect rules. I've included an example configuration for Apache and Nginx below:

Apache: Redirect from to (Learn More)

<VirtualHost *:80>
    Redirect /

Nginx: Redirect from http to https. (Learn More)

server {
    listen 80;
    return 301$request_uri;


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct