DEV Community

Discussion on: How to link Custom Domain with URL ?

richardj profile image

Well, you can't fully achieve that through a coding interface, i think. So let me draw you up how i have done it for some of my domains.

So i've built a website and that website is running on a certain with an IP. You can browse to that website by typing in the IP, and voila you see the website. But i want users to be able to visit my website through A few things need to happen:

  1. We need to tell whoever owns the domain, that when a user goes to that we actually want to connect with a certain IP address. This is what the DNS records are for. They tell you what it should actually looking at when a user sees and will be something like: A record

  2. optional: When you have a single server with a lot of websites on it we need to differentiate what website we want to show the user. Because how would we know which website to serve when we point to This is where the web server comes into place. In there you define configuration files which basically say: listen to this port, if the domain the request is coming from is load the following folders in the webserver.

So to go back. If you own a service like AND the user will buy their domain through you, you could do all the steps yourself programmatically (i think, there could be some caveat), if the domain name is bought with a different provider, the user needs to change the settings through their provider to point that domain name to the service (like And in most cases the user has to put in that information themselves.