I want to setup a system so that multiple custom domains like [mydomain.com/params] will redirect to [myapp.com/mydomain.com/params]. Can I do this using only DNS s
No, you can't use only DNS for that.
If every domain can run standalone (www.domain.com) this would be a straightforward multi-site setup and does not require mod_rewrite, just a bunch of
If you need exactly the setup you describe (http://www.hostname.com/www.2ndhostname.com/directoryname) you would need one
with all the domains as aliases, and a mod_rewrite based redirect to point incoming requests to the right directory.