Domain Name Service (DNS) does not allow for URL redirects where you may want a CNAME or a record to point to a full path.
For example, you may want the name www.mydomain.com to point to www.yourdomain.com/mydomain. While a CNAME could be set up to point www.mydomain.com to www.yourdomain.com, the web server operating www.yourdomain.com would need to direct the requests for www.mydomain.com.