Skip to content
← Back to Community
How to use a custom domain
Profile icon
dotcomboom

In case you've worked with repl.it before, you may have noticed that you are given a decently long subdomain for your project, like the following:
my-little-blog--dotcomboom.repl.co

You may have wanted to change that into a shorter, more memorable domain name, like this: mylittleblog.cf

Let's see how.

Getting your domain

This section will cover registering a domain name with Freenom. If you already have a domain, skip this part.

A word on Freenom

You don't own it

Freenom hands a selection of domain names out like free candy. If you've heard of dot.tk, it's these guys. In this tutorial I'll walk you through them, but I'd also like to point out that by registering a domain name with Freenom, you are still not entitled to it. It's perfectly valid and legal for them to all of a sudden deactivate your domain and use it to make money with ads, without notification. This is just a fair warning, some people have had domains from Freenom for a long time without any issues, but anything can happen. In short, nothing could be actually free. You are borrowing Freenom's domains for your purposes, and don't own them like you would from another registrar.

HTTPS

If you use Freenom, you won't be able to use HTTPS. You need to use "http://" before your domain instead. You will still be able to use your repl.co domain name if you need to use HTTPS, so make note of that. As https://repl.it/@turbio pointed out, HTTPS does work with a Freenom domain! You just need to wait a little bit of time for it to get set up. As for "mission critical" applications, like, say, Uptime Robot or something like that, you will probably want to use your repl.co domain.

Registering the domain

You will want to make or log into a Freenom account first. Then, you will be brought to the Client Area. Once you're signed in, you will find "Register a New Domain" under the Services menu.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543204601000_441af0314e3fc5e71a0139e9f766e678.pn

This will bring you to Freenom's domain search. Type in the name you want. In this example, I searched for "mylittleblog". It will give you a list of what domains they have available.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543204667654_d8c9142df0d4f1487abdc49631a435ad.pn

Choose the one you want, then scroll down to the bottom and choose "Checkout". Don't touch the section in the middle, we'll cover that later. Choose the period you'll be using the domain, which is from 3 months to 12 months. (If memory serves, when you're going close to the due date, you are offered the opportunity to renew.)

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543204740295_ac2737cabaa59f81f9e162774f281755.pn

Check the box to agree to the Terms and Conditions (reading them is a good idea too) and complete the order. Then, go back to your client area.

Attaching to repl.it

Repl.it setup

Go to your repl and click on the pencil icon next to the address in the preview pane.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543205234697_4f6cbafaf7aae5af99d0c74ae423b95f.pn

Type in your domain name and if the domain is registered correctly, it will prompt you to add a CNAME record to your domain:

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543205288588_5e41390b98167f4e887b0de892808666.pn

Copy where the record should point to, then go to your client area at your registrar (in my case, Freenom).

Registrar setup

From My Domains, go to the management page for the domain you chose. From Management Tools, choose Nameservers. Make sure it is checked to use default nameservers.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543205432252_a191c52c1f996716d91e8266a41efd7c.pn

Then, find the area where you can add records; for Freenom, it is "Manage Freenom DNS". In the Name textbox, enter your domain name, nothing more, nothing less. Change the type to CNAME. Then, set the target to what repl.it asked you. Then, choose Save Changes.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543205550116_8df6cb0139894e925b9a6fb80ea454aa.pn

Finish

Now go back to your repl. Repl.it now should have noticed that your domain is set up correctly and now lets you click on the Link button.

This file cannot be displayed: https://storage.googleapis.com/replit/images/1543205653984_83f953b10c6a8cbea3959c8f3709b06d.pn

You're done! Your domain should now be attached to your repl.

Voters
Profile icon
RayhanADev
Profile icon
Gia-ThienThien1
Profile icon
khww
Profile icon
JoeRumbon
Profile icon
hermitcraft
Profile icon
nathanTi
Profile icon
andrewdaukas
Profile icon
Peacebeast
Profile icon
WillyStroker1
Profile icon
IsaacCoolPerson
Comments
hotnewtop
Profile icon
Scoder12

I was having the issue of where its saying "CNAME records should have a name set! " but I just used www for the name and it worked as long as I put www.mydomain.tld in repl instead of just mydomain.tld

EDIT: I would honestly recommend using the free service cloudflare as DNS as it has a bunch of cool features in addition to supporting @ signs in their DNS. All you have to do is uenter the custom nameservers they provide in freenom.

Profile icon
ayuubOmer

@Scoder12 Thanks that really helped me!

Profile icon
PowerCoder

@Scoder12 Thanks!

Profile icon
AgastyaSandhuja

@Scoder12 If you want your domain to be the cname, just put an @ sign as the name. If you want a subdomain, put the subdomain name. It helps too.

Profile icon
Scoder12

@AgastyaSandhuja thats exactly the error I get when I put that lol. Freenom dns is so bad just use cloudflare

Profile icon
AgastyaSandhuja

@Scoder12 worked for me :/ maybe freenom is different.

Profile icon
Scoder12

@AgastyaSandhuja maybe they changed it since then but many people including me have gotten that same error when following the tutorial (judging by the other comments mentioning it and the amount of upvotes on my comments). Thanks for trying to help =)

Profile icon
LuukWalstra

@Scoder12
In Freenom you can't use the @ anymore as CNAME name. To use the website with a non-www domain, you have to use an A-record. To use it you have to get the IP Address of your website. Follow the next steps to do it.

  1. Open the command prompt (Windows) and type 'nslookup '[PUT HERE THE CNAME LINK FROM REPL.IT].
  2. You will see the next thing:
    image
    Under 'Non-authoritative answer:' You will see an IP Address.
  3. Make a new A-Record in the DNS managemant. Leave the name blank and set the target to the IP Address what you see in the Command Prompt. This is what you should have:
    image
  4. Save it and link the domain WITHOUT www.
Profile icon
Scoder12

@LuukWalstra that is a bad solution as repl.it's IP could change at any time. It is better to use cloudflare for this.

Profile icon
LuukWalstra

@Scoder12 They bought that ip address via Google. All codes from every website is in the Google Cloud so if they change there ip, everybody will lose there repls. So they won't change it.

Profile icon
Scoder12

@LuukWalstra technically true but I'm pretty sure repl.it checks for a CNAME and won't link unless the record is a CNAME, not an A. Using cloudflare takes like 2 extra minutes and gives you automatic TTL, which I'd say is worth it.

Profile icon
LuukWalstra

@Scoder12 The A record worked for me: https://wtalfa.ga

Profile icon
Blankjp

@Scoder12

Screenshot 2020-12-18 at 01.13.26
is this correct or am I doing something wrong(its at cloudflare)

Profile icon
Scoder12

@Blankjp you need to click the orange cloud to turn off proxying.

Profile icon
Blankjp

@Scoder12 acually even before I connect to replit, cloudflare and freenom aren't connected.
image
I've changed the nameservers and already waited half a day.But still it won't connect.

Profile icon
Scoder12

@Blankjp Thats weird. Can you send a screenshot of the nameservers screen on freenom?

Profile icon
SushantShah

@Scoder12 True I too Use Cloudflare Because '@' Wildcard is allowed at root domain and I Am Also Using improveMX For Email... Remember I am No Representative but its a free(somewhat) and cool tool

Profile icon
Scoder12

@SushantShah yes I use improvMX too, it's great

Profile icon
GreenThatGender

@Scoder12 i have the same issue, the name servers wont change
annoying

Profile icon
AarushTahiliani

@GreenThatGender hey on my repl there is no pencil icon how do i link it with cloudfare or freenom

Profile icon
PyCoder01

@LuukWalstra The A record worked. But it can only work on one record. so no www. So I'm not doing it

Profile icon
DillonB07

@Scoder12 Thank you!
That really helped me!

Profile icon
4515384697

@Scoder12 freenom's dns is broken so until they fix it we have to want.

Profile icon
TNJS

By subdomainn, do you mean like 'images'[email protected]

Profile icon
cGIfl300

@Scoder12 Yes, you CANNOT use a CNAME on a toplevel.tld, this must be a A record, for any subdomain such as www. or whatever.toplevel.tld you can use a CNAME.

Profile icon
randomguycoder

@Scoder12 The thing is that I think it's paid so if you're just doing a test website then use freenom but if you're making a professional website then use Cloudflare.

Profile icon
timmy_i_chen

Thanks for writing this up! Solid!

Profile icon
LeoXu2

How do i do a subdomain?

Profile icon
BulletOtaku

Hey, I'm using Cloudflare DNS, and I added an unproxied CNAME record. The windows says 'You're All Set!', but when I press link the button just stays buffering. Any idea what to do - do I just wait?

Profile icon
freddyamarsden

How long does it take to link? Its not really working

Profile icon
Scoder12

I would really advise against using freenom's built-in DNS and using a provider such as cloudflare instead. Aside from cloudflare many additional features (many of which are less useful on repl.it but still really good) it allows you to change the DNS root values unlike freenom and allows you to specify an automatic TTL. Just make a clouflare account, put in your freenom domain, log into freenom, and change your nameservers to the ones clouflare provides for you. I fully recommend it to anyone trying this.

Profile icon
dotcomboom

@Scoder12 Will definitely give this a shot sometime! If I could pin this, I would, since that'd solve the issue with needing to use a subdomain for the CNAME record.

Profile icon
AgastyaSandhuja

@Scoder12 would my DNS records from before save? I'm trying to consider it.

Profile icon
Scoder12

@AgastyaSandhuja yes it transfers all of your old records. Quite painless just takes a few mins to set up.

Profile icon
AgastyaSandhuja

@Scoder12 thanks!

Profile icon
4515384697

@Scoder12 freenom's dns is broken so until they fix it we have to want.

Profile icon
Scoder12

@Dheeraj2008 trust me they never will

Profile icon
4515384697
Profile icon
Scoder12

@Dheeraj2008 because why would they? CNAME flattening would take engineering hours with no added benefits for them

Profile icon
Coder100

The REPL doesn't connect for some reason :(

Profile icon
Tricksyz

@Coder100 what do you mean it doesn't connect? Does the repl not load even with the default URL? Is it not detecting the CNAME record?

Profile icon
Coder100

@Tricksyz It's not detecting the CNAME record :(
Sometimes it does work, but I think I got the REPL wrong: http://cma-chat.cf/

Profile icon
Tricksyz

@Coder100 Since CNAME doesn't support root domains, you will have to change the name in Freenom to www. Then, when you're linking the domain on repl.it, type in www.cma-chat.cf. It should work then.

Profile icon
Coder100

@Tricksyz ok. Thanks!

Profile icon
CoolCoderSJ

@Tricksyz I saw this way too late, but yeah this should be mentioned somewhere

Profile icon
PikachuB2005

@Coder100 asked for help?!?

Profile icon
Coder100
Profile icon
PikachuB2005

You help everyone else so much it was strange to see you confused, even if it was 2 years ago.

Profile icon
w1l7

How can I connect a freeDNS (with namecheap) to my replit website?

Profile icon
LuukWalstra

In freenom you can't use the @ anymore as CNAME name. To use the website with a non-www domain, you have to use an A-record. To use it you have to get the ip address of your website. Follow the next steps to do it.

  1. Open the command prompt (Windows) and type 'nslookup '[PUT HERE THE CNAME LINK FROM REPL.IT].
  2. You will see the next thing:
    image
    Under 'Non-authoritative answer:' You will see an IP Address.
  3. Make a new A-Record in the DNS managemant. Leave the name blank and set the target to the IP Address what you see in the Command Prompt. This is what you should have:
    image
  4. Save it and link the domain WITHOUT www.
Profile icon
turbio

This is super cool!
I want to mention though that HTTPS should work just fine. The first time you visit your domain it might take a few seconds to get a cert, but after that, it'll be fast forever. Let us know if you ran into any problems getting https to work.

Profile icon
dotcomboom

@turbio Thanks for pointing that out! I'll update the tutorial.

Profile icon
MatthewDoan1

ok dotcomboomer

Profile icon
IchBinTimmy

image
I don't have the pencil icon. Can some one help me?

Profile icon
AarushTahiliani

@IchBinTimmy BRO SAME WTF

Profile icon
KadenBlox

@IchBinTimmy I think it needs to be a HTML, CSS and JavaScript project for it to work. Not 100% though.

Profile icon
nbbcsf

@KadenBlox if you make a server you could also do the same thing. @IchBinTimmy try turning off your adblocker.

Profile icon
ch1ck3n

What about dreamhost, or AWS?

Profile icon
EclipseEevee

says gotta run repl to do it... https://www.bothelpertk
idk why, mine is running :/

Profile icon
saulbaizman

Freenom is dead. Whenever you try to register any domain name, the confirmation screen says "Thank you," and in text toward the bottom that is easy to overlook, it reports an error: "Some of your domains could not be registered due to a technical error. These domains have been canceled." See attached screenshot.

Screen Shot 2020-12-08 at 19.51.50 copy

This tutorial should be either 1) removed or 2) revised to discuss in generic terms how to add a CNAME DNS record to a domain name, irrespective of Freenom or 3) revised to discuss how to add a CNAME DNS record with another domain name registrar that still functions.

Hopefully this post will save someone several minutes of confusion / banging your head against the wall.

Profile icon
4515384697

@saulbaizman u have to put ur real address and not use vpn while registering.

Profile icon
ErrorbotTHE2nd

do you have to use freedom and are there any other websites that offer the same things?

Profile icon
Blankjp

@ErrorbotTHE2nd Freenom and dot.tk are the two site that provide free web-hosting.
domains.google.com,hostinger do host websites thought all of them are paid.

Profile icon
Nefomemes

Freenom is now broken. Anyone know how to resolve this?

I haven't created a Freenom account with this email btw.

Screenshot_20201201-110715_Samsung Internet

Profile icon
Code1Tech
Profile icon
MrDragonDev

I know a site that has (kinda) cheap domains, its called oxide.host, its a United Kingdom based company founded in London, and the domains are kinda cheap. I got mine, but I recommend doing oxide.host for domains. You can do it in EUR or USD.

Profile icon
KrishnaDas3

Quick question, is there any way to get www to work with the @ in Cloudflare?

Profile icon
RaidTheWeb

Great Tutorial dotcomboom but Scoder is right Cloudflare works better.

Profile icon
Baconman321

@dotcomboom Nothing works. Every single time I try to check availability, it says not available, but if I look it up, it says the ip address of that site isn't found. I think it means the website isn't even there. And also, I can't sign up. There is no sign up option anywhere. I don't think this works.

Profile icon
AgastyaSandhuja

Worked fine, but when I went to the website I hosted on, it just said "run your repl to see the output"
how can I fix this?

Profile icon
[deleted]

@AgastyaSandhuja I'm getting this same issue by the googling I did seems like it might be broken

Profile icon
pratyaysaha

Ping your server every 5 mins with a setinterval func if using JS

Profile icon
AngelinaMay

I got this error after following the instructions with NameCheap: "Tried to reach our servers but we got an unexpected host header, is there a proxy in the way?"
What might I be missing?

Profile icon
Woutervan17

@AngelinaMay any idea

Profile icon
ML1012018ZHENG

i got DNS Management is temporarily unavailable. Please try again in a minute. Can anyone help

Profile icon
spaker6554

6d94dc7a-9113-4c76-b68b-405a5b7895f8.id.repl.co

Profile icon
Muhammadzakirha

Help im stuck

Profile icon
asduwuwueurdu
Profile icon
CampbellMartin

Didn't work

Profile icon
Meskelon-Inc

Replti says that the domain is configured correctly but when I click 'link Domain' it says "Linking..." for about 10 seconds the just stops and doesnt link it