You need to register your domain name because it’s a key component of your website.
When you register your domain name, you are declaring that you own the domain name and it has become part of the DNS system.
Domain Name System (DNS) is a system used for finding computer services or information on the Internet by using a unique type of name.
So once you registered your domain name it will create a unique record in DNS space that will point to your web hosting.