$ host -t CNAME phpmya.abc.pl
phpmya.abc.pl is an alias for phpmya.foo.com.abc.com.
I’ve decided to add the dot at the end of CNAME value so it would return phpmya.foo.com. in a fashion of NS records:
phpmya.abc.com IN CNAME phpmya.foo.com.
And now when I test out the CNAME record - it still points at the old value:
$ host -t CNAME phpmya.abc.pl
phpmya.abc.pl is an alias for phpmya.foo.com.abc.com.
For the time being I’m using Apache2 redirection (same way like admin.${DOM} works) but I would like to utilise CNAME record. Any ideas what I’m doing wrong?
Ummm just exploring options.
Ws thinking if I add BIND records for new domains (in Server Templates > DNS domain) it will be automatically created and since I already have a sub-server phpmya.foo.com
Honestly I don’t see any advantage nor disadvantage over Apache Redirect. Just wondering why CNAME doesn’t work. Would like to make it work but I’ll be ok with Apache Redirect though…
There’s also one more thing. I’ve deleted the CNAME record. Waited out 24h and added CNAME record again with absolute value.
# abc.com zone:
phpmya.abc.com. IN CNAME phpmya.foo.com.
And now it kind of works but… My server (Apache) is serving the contents of /home/foo.com/public_html instead of /home/foo.com/domains/phpmya.foo.com/public_html
But… When I open this address (phpmya.abc.com) I should get the contents of of my sub-server: /home/foo.com/domains/phpmya.foo.com/public_html, right?
But I don’t.
When I open phpmya.abc.com the address in the browser remains the same (and that’s ok) but the contents of the website are from /home/foo.com/public_html. Which is the parent domain hosted on my server. That is why I created sub-server to separate PHPMyAdmin installation from my “main” domain.
Cname just follows the IP of phpmya.foo.com, its just like adding the same A record for phpmya.abc.com that the same as phpmya.foo.com. Its basically a time saver changing alot of A records.
Apache handle all your web redirection like what you have for webmail.domain.com.
Check the Edit Directive in Config Website. I think what what you need to do.
There is Website Redirects in the gui as well.