Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to use a custom domain
dotcomboom (93)

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:

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.


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 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.

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.)

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.

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

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.

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.


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.

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

KrishnaDas3 (0)

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

SamuelBlue (0)

Can I do this for repl.run repls? I'm not seeing the edit button.

huseyn1992 (0)

Anyone using purchased domain from DOMAIN.COM ? I purchased domain and trying to connect via CNAME (following above steps). Step 3 loading for 24 hours now, still nothing updated... Has anyone experienced similar delays?

thebeastygamer (0)

is it possible for a domain that is free forever?

ChezCoder (1484)

@amasad my custom domain is not linking style.css and script.js. Is this a problem with replit or my registrar? The page exists but its blank :(

BulletOtaku (0)

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?

RaidTheWeb (56)

Great Tutorial dotcomboom but Scoder is right Cloudflare works better.


When i try this it just says "attempting to contact dns through replit this may take 48 hours" or something

bikkie (0)

when i try to sign up it says “you could not be verified as a human” what

liamhuizinga (0)

Does this only work with HTML or also with PHP?

RohilPatel (810)

I'm getting an error that says I'm not a human

Baconman321 (65)

@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.

LuukWalstra (4)

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:

    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:
  4. Save it and link the domain WITHOUT www.
keyman500 (0)

I'm not getting any domain from freenom after checkinh it's availability i click get it now but it just loads and says not available after that for any domain that i try too create

AgastyaSandhuja (146)

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?


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

AgastyaSandhuja (146)

Did all of this, but when I go to my site, it says
"run your repl to see the output"
anyone know ho to fix this?

ArtsyGalaxy (0)

It's been over 2 hours, how long should it take to connect the domian

ArtsyGalaxy (0)

Hey there what do I do if I paid for a GoDaddy Domian, will I be able to still connect it??

Scoder12 (681)

@ArtsyGalaxy yes just link it to cloudflare.com or use godaddy's builtin dns

AngelinaMay (0)

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?

VincentKok (0)

it gives an error on repl where it says we ran into an internal error.

Will_builder8 (4)

It has been a while and it is still looking, what is going on?


This has saved me from a tone of headaches.

Thank you

freddyamarsden (21)

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

Coder100 (4538)

The REPL doesn't connect for some reason :(

Tricksyz (18)

@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?

Coder100 (4538)

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

Tricksyz (18)

@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.

ML1012018ZHENG (0)

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

Scoder12 (681)

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.

dotcomboom (93)

@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.

AgastyaSandhuja (146)

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

Scoder12 (681)

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

26325001 (19)

How long does it take for the site to be deployed? (I am looking at a 404, waiting for my site)

themaka (183)

@26325001 Last time I did it, it took about 15 minutes, but it could take a couple of hours depending on the systems being used.

lolfail (24)

But when renewing do we have to pay for it?