-1

I am not sure if this question belongs here.

I have got a new server. It provides three IP addresses. There is a DNS manager where I can setup domain name at a particular IP. Done successfully, and added domain using virtual host. Its working fine.

Now, I want to create a subdomain. As I said, there is no A/AAAA record option in dashboard (which I got from my previous host). I am trying to add subdomain using virtualhost, but it doesn't work.

<VirtualHost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin *********gmail.com
ServerName sub.domain.com
ServerAlias sub.domain.com


# Index file and Document Root (where the public files are located)

DirectoryIndex index.php

DocumentRoot /home/ApacheWebsites/subdomain

# Custom log file locations

LogLevel warn

ErrorLog /home/ApacheWebsites/logs/error.log

CustomLog /home/ApacheWebsites/logs/access.log combined
<Directory /home/ApacheWebsites/subdomain/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
allow from all
</Directory>

</VirtualHost>

So my questions are :

1) Does A record matters while creating subdomain ?

2) Does having different IP address for different domains matters while creating subdomain for a domain name ?

3) Solution ?

akshayb
  • 101
  • 3

1 Answers1

1

Does A record matters while creating subdomain

Creating the A record is how you create the subdomain!*

You don't create the subdomain in apache, you create it in your DNS, and then configure apache to serve content for it.

You state that you don't have an option in your panel to create an A record... You NEED that option in order to accomplish that which you are attempting. You need to create the A record with whoever is providing the Name Servers for your domain. If your domain's DNS is provided by your registrar, you need to create the A record there, and NOT with your webhoster.

*AAAA, CNAME, or NS record(s) could also be used to create a subdomain, but in this specific case, an A record pointing to the correct IP is what will actually create the subdomain....

Joe Sniderman
  • 2,809
  • 1
  • 22
  • 26