This is the fourth part of our DirectAdmin Tutorial Series. If you are setting up a new VPS, we recommend starting with part 1.
In this part of our tutorial series, we’ll show you how to link (sub)domains to your VPS. We assume you also want to use IPv6 for your (sub)domains. Although your VPS automatically comes with an IPv6 address, it is not automatically used by DirectAdmin. Therefore, we’ll first show you how to activate your IPv6 address in DirectAdmin.
Linking your (sub)domains to your DirectAdmin VPS is a two-part process: you point the domain’s DNS settings to your server, and then you add the (sub)domain to a user account.
IPv6
Do you want to use multiple IPv6 addresses? For example, one IPv6 address per reseller or account? Then first add an additional IPv6 address to your VPS, see this guide.
If you want to use IPv6, an additional adjustment is required within DirectAdmin. Without this adjustment, visitors to domains on your server who try to use IPv6 will see the message 'Apache is functioning normally'.
Step 1
Log into DirectAdmin at 'Admin Level' and click on 'IP Management'.
Step 2
Click on the ‘Devices’ tab and copy the primary IPv6 address (or whichever IPv6 address you want to use if you have multiple linked).
Step 3
Now navigate back to the ‘IPs’ tab and click on ‘Add IP’ at the top right.
In the ‘add IP address’ pop-up window, select ‘IPv6’, fill in the IPv6 address you copied in step 2. Add the /64 subnet mask to the IPv6 address and click on ‘add IP’.
Step 4
You are now back in the 'IP Manager' overview. Click on the newly added IPv6 address.
Check the ‘Global’ option: the IPv6 address is now available for all reseller accounts on your server. Without this option, resellers (and therefore accounts under that reseller) can only use IPv4.
Adding a (sub)domain in DirectAdmin
In the steps below, you’ll add a domain to a DirectAdmin user. Before going through these steps, make sure you have created a user package.
Step 1
Log into DirectAdmin as the user to whom you want to link the domain (if it's an administrator account, switch to 'User Level' in the left navigation menu). Then click on ‘Account Management’ > 'Domain Setup'.
Step 2
When creating a user, you have the option to add a domain. If you didn’t use that option or just want to add an extra domain, click on ‘Add New’.
Tip: Made a typo when adding a domain? Correct it on this page via the ‘Rename domain’ button.
Step 3
Enter the name of the domain you want to add and adjust the other options as desired. Then click on ‘create’.
The convenient part here is that as a user, you also have control over some additional options. For example, you can divide disk usage within a package over multiple domains.
You will then automatically return to your domain overview and briefly see a message that the domain has been added.
Adding a subdomain
Adding a subdomain works similarly to adding a domain. Keep in mind that if you follow our security advice, you can only create subdomains for accounts that also own the main domain.
Step 1
Log into DirectAdmin as the user to whom you want to link the domain (if it's an administrator account, switch to 'User Level' in the left navigation menu). Then click on ‘Account Management’ > 'Subdomain Management' > ‘Add Subdomain’.
Does your account have multiple domains? You can adjust for which domain you create a subdomain by clicking on the domain name at the top right and adjusting the selection.
Step 2
Enter the name of the subdomain and click on ‘add subdomain’. Optionally, you can adjust which directory on your server the subdomain’s website files are stored in.
Nameservers
- It is important that you have set up nameservers on your DirectAdmin VPS as described in part 1 of our tutorial series under ‘Adjusting the hostname and nameservers’.
- Are the domains you host registered with TransIP, and would you prefer to manage the DNS from the TransIP control panel? Then skip to the next section ‘DNS’.
- DirectAdmin automatically creates the correct DNS records for your domains.
You can manage the DNS records of domains hosted on your DirectAdmin VPS from DirectAdmin. This is useful if you host domains for clients whose domains are not registered with TransIP. In that case, change the nameservers the domains use to those of your VPS as follows:
Step 1
Log into the TransIP control panel and go to the ‘Domain & Hosting’ tab. Click on your domain name and scroll to ‘Advanced domain management’.
Step 2
Then (if enabled) disable the TransIP settings, point the Primary and Secondary nameserver to the nameservers you set up in part 1 of our DirectAdmin tutorials. Finally, click on ‘Save nameservers’.
DNS
Websites you host on your VPS are not automatically accessible worldwide. To make them accessible, the DNS records of your domain need to point to your VPS. How this works depends on whether you manage the DNS records from the TransIP control panel, from the DirectAdmin server, or via an external provider (this last option is outside the scope of our guide).
Managing DNS records via the TransIP control panel
Refer to our article ‘Linking your domain name to your VPS’ for an explanation of how to point your domain’s DNS records to your DirectAdmin server. Below is an example of the final result for a DirectAdmin VPS.
Make sure you use the correct IPv6 address in your DNS settings, see part 1 of our tutorial series.
Managing DNS records from DirectAdmin
DirectAdmin automatically adds the correct DNS records to your domain. You only need to point the nameservers of your domain to your DirectAdmin server without adjusting anything else in the DNS records. Note that the TTL (i.e., how often to check if DNS records have been updated) is set to 3600 by default (one hour). If desired, you can change this to 300 (5 minutes) on the page described below.
Do you want to adjust, add a DNS record, or change the TTL of your DNS records? This can be done from the account where the domain is located. Navigate to ‘Account Management’ > ‘DNS Management’ and add a new DNS record, adjust an existing one, or change the TTL for all your DNS records.
Linking multiple domains to one website
You may want more than one domain to point to the same website. DirectAdmin uses 'Domain Pointers' for this. To use this feature, the website you want to point to and the domain you want to redirect must be in the same user account.
Step 1
Log into DirectAdmin as the user for whom you want to create the Domain Pointer. Then click on ‘Account Management’ > ‘Domain Pointers’, and then at the top right, click ‘Create Domain Pointer’. At the top right again, you can adjust for which domain you are creating the Domain Pointer.
Step 2
Enter the name of the domain you want to link to the domain where the website is actually hosted and click on ‘create’.
Step 3
Are you managing the DNS records for the domain you’re creating the Domain Pointer for in DirectAdmin? Good news: DirectAdmin also automatically creates the correct records for you, and you're done with this part.
Are you managing the DNS records externally, such as in the TransIP control panel? Then set the DNS records for the domain as described in the ‘DNS’ section.
Now that you’ve linked your domain to your VPS, you can start setting up your website and/or email. Continue to part 5 for uploading your website, database, and using SSL, or go to part 6 if you only want to set up your email.
Should you have any further questions after reading this article, feel free to contact our support team. You can reach them via the 'Contact us' button at the bottom of this page.