3
6 Comments

How can we link one domain to a deployed site programmatically?

I want to deploy a site and link domain to that site. My idea is to work on a website creator platform. Create that website using predefined theme and host it somewhere. What is the best place to deploy React site and how can we link a user-entered domain to that site?

on October 24, 2020
  1. 2

    Translation of (sub)domain -> server IP happens at the DNS level. You would need to add a A/CNAME type record for that (sub)domain/ with your domain management service. If you're using Cloudflare, they have an API which allows you to do this programmatically https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record.

    I hope that explains things a little bit. Let me know if you have any follow up questions.

    1. 1

      thanks. I got the point.

  2. 1

    Hi Kaushik,

    Can you explain your use case a bit more? We’ve been working on a solution for something like this at Loophole Labs (the team behind https://lynk.sh and https://pigeonpost.io) but we’re still trying to gather market data before we finalize the product.

    1. 1

      Hi, basically I want to host a React app programmatically and link one domain programmatically. I am not sure what would be the right way to do that.

      1. 2

        Hiya!

        I understand what you need. You’d basically like a programmatic way to handle linking a custom domain to an existing domain - ideally using something like an API.

        This is something that we’ve been working on at Loophole Labs for the last few months! If you send me an email at admin@loopholelabs.io I can explain a bit more about how it works and we can talk about access to an early beta version of the platform.

        1. 1

          Thanks. I will forward this to my partner.