I’m running a site on an apache server named www.example.com which has sub.example.com subdomain. Also I have a vps, which is accessable through x.x.x.x IP adress. sub.example.com is redirected to x.x.x.x with htaccess So I can reach my files on x.x.x.x through sub.example.com.
Everything is ok with this. But I want to solve this issue with DNS. How can I achieve that?
I’m using cpanel on http://www.example.com.
I searched a lot about that issue and find some information but I’m not fully aware of DNS settings. So I need a step by step guide.
Change the DNS entry for
sub.example.comand modify the A record tox.x.x.x.On your vps, update apache config to host the domain
sub.example.com. Configure a name based virtual host.