Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to link your custom domain to your repl!
h
CoolJames1610 (775)

How to link your custom domain to your repl!

Hello everyone and today I will be going through how to link your custom domain with your repl with cloudflare being the DNS provider!

Here are what I will be going through today!

Contents

  • Introduction
    • What are domains?
    • What is Cloudflare?
  • Setting everything up
    • Getting the replit code.
    • Setting up cloudflare DNS field.
    • Linking domain.
    • Finishing.
  • Outro
    • Closing.

Introduction

What are domains?

The official answer to this question is:

A domain name is an identification string that defines a realm of administrative autonomy, authority or control within the Internet.

In simple terms (I guess xD) and in my own understanding, a domain name is simply an easy way for humans to remember and visit webpages.
Every website has its own unique IP address but you know, humans are bad at remembering things like IP addresses. Like, what is your IP address? xD (DONT COMMENT YOUR IP ADDRESS XD).
So, instead we have domains! When you input a domain, it goes through a Domain Name Server (or a DNS!) which locates the correct IP address for that domain. Which then allows the webpage to be loaded from the IP address.
They are very convenient and is quite cool to own a custom domain. Unfortunately, there are no such things as "free domains" but you can get cheap ones at places such as Google Domains or NameCheap!

So what is cloudflare?

What is Cloudflare?

Cloudflare, Inc. is an American web infrastructure and website security company that provides content delivery network services, DDoS mitigation, Internet security, and distributed domain name server services

It basically helps you manage your domain and provides security!
Cloudflare is one of the most popular DNS providers and it is totally free! (well some services aren't xD)
I personally would recommend it as it is very easy to use and gives you lots of information about how your website is doing.

So, how do we setup our custom domain?


Setting everything up

Getting the replit code.

For this tutorial, I will be using a HTML repl (just because it already has a screen open), but you can use whatever language you like as long as you're able to get the webpage screen thingy up.

So, getting the code is very simple.
In the heading of the screen, you will see:

  • A refresh button
  • The domain name that repl have given you
  • A pencil button
  • An "open new tab" button

Now, you want to click the pencil button as that is how we are going to input our custom domain.

In the "Enter your domain" part, you put in your domain as follows:

  • If you have a root domain (e.g. zeliktric.com)
    • Simply type zeliktric.com or www.zeliktric.com (you can use Cloudflare page rules to redirect zeliktric.com to www.zeliktric.com automatically if you wish)
  • If you have a subdomain (e.g. tutorial.zeliktric.com)
    • Simply type tutorial.zeliktric.com (no www.).
      Cloudflare does not allow you to have something.something.domain.com

Then, a code should appear. Copy it and head to cloudflare.

Setting up cloudflare DNS field.

Now, you want to create a cloudflare account if you haven't done so and head to your domain.
If your domain is not on cloudflare, simply follow the instructions that cloudflare gives you and you should be able to get your domain onto there.

Head over to the DNS section:

Press Add record:

For the Type, you want to set it to CNAME.
For the Name, you want to set it to:

  • If you have a root domain
    • @ or www
  • If you have a subdomain
    • tutorial (if it is tutorial.zeliktric.com)

For the target, you put in the code that replit gave you.

AND NOW FOR THE MOST IMPORTANT STEP

Set the Proxy status to DNS Only (just toggle the toggle (wut xD?))
It should now look something like this:

Hit save and now head back to your repl!

Linking domain.

Now you have entered the information onto Cloudflare, click the Next button on the repl.

Fingers crossed, THIS should appear after 0.idk seconds xD

Click Link Domain and after a few seconds, THIS should appear on your screen:

YAYAYAYAYAYAYAY
YOU'VE SUCCESSFULLY LINKED YOUR CUSTOM DOMAIN TO YOUR REPL!!!

HOLD UR HORSES! We haven't finished yet xD

Finishing.

Head back to Cloudflare and hit Edit on your field.
Then change the Proxy Status back to Proxied

Proxied means that the traffic goes through Cloudflare and not to your IP address.
This is why, I think that there were linking issues.

DNS only means that traffic goes straight to your IP address, which in this case is your repl's IP address.

After you have linked, you want it to be Proxied so that traffic goes through Cloudflare and if you're being attacked, Cloudflare will be able to deal with it.
This is why Proxied is turned on by default.


Closing

Well, I hope you've learnt something new with this tutorial.
It has worked perfectly for me and it has been great :DDD

Please upvote, not because I want upvotes (I'm inactive on this account anyway xD) but so that more people can link their custom domains with their repls!

Thank you for reading and have a nice day :PPP
@CoolJames1610 (now using @Zeliktric)

Comments
hotnewtop
MrVoo (102)

" Unfortunately, there are no such things as "free domains" "
Are you sure about that? https://www.freenom.com/en/index.html?lang=en

CoolJames1610 (775)

@MrVoo They are bad, I advise heavily against using them.

MrVoo (102)

@CoolJames1610 If you say so, but now I wanna know why :)

CoolJames1610 (775)

@MrVoo You don't have complete control of that domain, as freenom can withdraw it or make you pay at any time. Also many domain services (like email) block freenom domains

MrVoo (102)

@CoolJames1610 I dont think any of that is true, but if you say so

ch1ck3n (2393)

@MrVoo freenom yes it is free but it is very slow and insecure

also they only have .tk and .rm domains free

MrVoo (102)

@ch1ck3n Last time I checked they had a lot of free domains, maybe it changed :P