In my mind when the user request
http://www.xyz.com the hostspot dns system should check for the first name and not just for the last one,, appear to be a bug in the hotspot system.
This doesn't matter for CNAMEs.
The reason is simple:
1) https is encrypted, so the hotspot cannot monitor for URLs being grabbed - this is why SSL requires IP-based walled garden control.
2) If a name you enter is a CNAME (not an A record) this doesn't matter - it must eventually lead to an IP address, and it's the IP that gets blocked, not the name.
2) as long as the blacklisted CNAME points to something that points to the same IP address, then the block will work.
The problem that DOES happen with CNAMES is that the IP gets blocked no matter what name it's called by.
Suppose bad.com -> web.hosting.com and good.com -> web.hosting.com
In this case, the Walled Garden will block the IP of web.hosting.com , so even though you might want to allow good.com, while blocking bad.com - this is not possibly by IP address, because both names resolve to the same IP address, and this is the same whether the RR is a CNAME or an A record.
There are some reasons it might not completely work that aren't directly related to CNAMEs. If a site's DNS does global load balancing or any other kind of fancy stuff where different requests get different replies based on some criteria, then your user's request for bad.com might just receive a different (set of) IP address in the reply than the Mikrotik did whenever it performed its own query. The way to combat this possibility is to force users to use the Mikrotik as their DNS server (either assigning it in DHCP directly, or by transparently redirecting DNS queries to the Mikrotik with a DSTNAT rule). That way, they're forced into having the same exact view of DNS upon which the IP policy is based.