DEV Community

Discussion on: How to link Custom Domain with URL ?

prakis profile image

Lets say you want to build a website like wix and you want to let users point their domain to your server. First you need to run a webserver (assuming the site is a static sites) you can use something like which is perfect for static sites with custom domains (even other webservers can do that like Nginx).

Now assume two users A and B want to point their domains(lets say and What you need is the following..

Then you will ask your users A and B to point their domain names to A/CNAME to your server IP address. On your Caddyserver you will add these two domain names and point to a local directory like /user-sites/A-com/ which will have all the static sites like index.html ...

When the DNS for arrives at your server, CaddyServer will serve files from /user-sites/A-com directory.