I have a site working on a VM with Debian and Apache. The site is sitename.example.com . Now, I need to add a subdomain like subdomain.sitename.example.com on the same IP.
What have I done until now:
000-default.conf
<VirtualHost 192.167.102.49:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/iamanuser/www/subdomain/public_html
ServerName subdomain.sitename.example.com
ServerAlias subdomain.example.com
</VirtualHost>
apache2.conf
<Directory /home/iamanuser/www/subdomain/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<VirtualHost 192.167.102.49:80>
ServerName www.subdomain.sitename.example.com
DocumentRoot /home/iamanuser/www/subdomain/public_html
</VirtualHost>
etc/hosts
192.167.102.49 sitename.example.com
192.167.102.49 subdomain.sitename.example.com
sitename.example.com works perfect, but everytime I go for subdomain.sitename.example.com the DNS can't be resolved. I'm literally going crazy, please help me. Thanks in advance.