I'm a software developer and I'm looking to buy a domain so I can host my current and future projects on. I've done research, but as I'm still not sure if I understand this correctly, I am asking here for help.
Let's say I have bought an example.com domain. As the DNS system is hierarchical, I also now own all the subdomains of example.com, like a.example.com, b.example.com and a.b.c.example.com. So, for every new project that I want to deploy I will be able to allocate a projectname.example.com domain.
To exercise this ownership, I'm being given access to the NS record of the .com domain registry through registrar, so i can set the DNS server responsible for resolving my domain. By default this is going to be the server that registrar has provided me with.
When I deploy an application to the cloud, I'll get a url, for example project1.heroku.com. To redirect traffic, I can just create a CNAME or ALIAS records from project1.example.com to project1.heroku.com
But according to the Heroku documentation, I need to add the domain to heroku itself and then crate a CNAME record to url which I will be given upon doing so. Why is that, and why wouldn't the normal url work? Or do I really don't understand something?