if you use AWS, a redirect like
mail.foo.com --> mail.google.com/a/foo.com
can be setup as follows:
- in s3, create an empty bucket "mail.foo.com"
- under Properties -> Static Website Hosting, set "redirect all requests to: mail.google.com/a/foo.com"
- in route53, create an A record "mail.foo.com"
- enable "alias", and set alias target to the "mail.foo.com" bucket
not a pure DNS solution, but it works ;)
But be aware of, the redirect skips all the URL parameters e.g.: ...?param1=value1¶m2=value2