hey hackers - for services where you allow users to bring their own domains, how do you guys go about it? Any tips on going about this manually, and programmatically?
This really depends on too many variables to provide a pin-point answer, like, where do you host the service, or, what's your Internet-facing webserver?
When you're using Apache or nginx as a webserver, you could accept requests from all subdomains and proxy the request to your backend, but add the extracted subdomain as a header. Then, you could parse this header in your backend (using a middleware/filter) and determine your user accordingly.
Here's a corresponding nginx example (via Reddit):