Implement chained aliases

Handle chains of CNAMEs correctly.