# DNS setup for a custom domain

**URL:** https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742
**Category:** Hosting Support
**Created:** [December 13, 2021, 3:32pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742 "2021-12-13T15:32:33Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 3:32pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/1 "2021-12-13T15:32:33Z")

</div>

I registered a domain from iwantmyname that I’ve been mainly using for emails (hosted on Zoho Mail). Now I would like to create a simple website on Infinity Free using that domain.

I changed the nameservers to [ns1.epizy.com](http://ns1.epizy.com) and [ns2.epizy.com](http://ns2.epizy.com), and that caused my website to appear. However, it also caused my email to stop working. So I reverted the nameservers back to iwantmyname.

Is there a way to keep my domain registrar’s nameservers and still host my website on Infinity Free? In my registrar’s DNS control panel I can add DNS records. I use them for my email host, and I used a CNAME record for an old website I hosted somewhere else. But I’m not sure how to set them up for Infinity Free. Could anyone help?

I’m a complete newb when it comes to DNS.

Thanks.

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 3:34pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/2 "2021-12-13T15:34:28Z")

</div>

You need to add **A** of your domain pointing to the server IP addressed in the client area

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 3:35pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/3 "2021-12-13T15:35:56Z")

</div>

![image](https://forum-cdn.infinityfree.net/original/3X/8/e/8e84b4e723620a2c80dc8830961291074321cd54.png)  
Example!

---

<div class="post-metadata">

### Author: ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)
#### Post date: [December 13, 2021, 4:03pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/4 "2021-12-13T16:03:02Z")

</div>

You’ll want to setup a couple of DNS records:

- A DNS record of type `A` for your base domain. This should point to your **Website IP** , which you can find in the client area.
- A DNS record of type `CNAME` for the `www` subdomain, pointing to your base domain.
- If you have any subdomains created through our panel, you’ll also need to setup CNAME records for each of those pointing them to your base domain.

Any existing DNS records for the base domain of type `A` or `AAAA`, and any records for the `www` subdomain or other subdomains you’re hosting with us, should be deleted.

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 4:10pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/5 "2021-12-13T16:10:46Z")

</div>

when you say base domain, you mean “@” ?

So:  
@ A x.x.x.x(IP)  
www CNAME @  
subdomain1 CNAME @

?

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 4:17pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/6 "2021-12-13T16:17:28Z")

</div>

I managed to create

- @ A x.x.x.x

However when I try to create

- www CNAME @  
I get the following error: “Please enter a valid hostname (IP addresses and paths are unfortunately not allowed)”

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 4:18pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/7 "2021-12-13T16:18:06Z")

</div>

Don’t get confused. `@` means your domain name. In destination you must copy-paste server IP from your client area. Why are you referring to CNAME records?

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 4:18pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/8 "2021-12-13T16:18:57Z")

</div>

Can you share the image of the error with the record.

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 4:32pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/9 "2021-12-13T16:32:51Z")

</div>

I did put the IP when creating A entry.

What I’m not sure how to do is the CNAME entry for www subdomain (as Amin mentioned above).

See screenshot. The first 2 CNAME, MX and TXT entries are for my email.

 ![dns](https://forum-cdn.infinityfree.net/original/3X/6/f/6f89be2edaf1e1aa9770205976305cc99299530a.png)

---

<div class="post-metadata">

### Author: ![HELPINDIA](https://forum.infinityfree.com/letter_avatar/helpindia/32/5_5575768a8748004e209b776fc1b2916d.png) [@HELPINDIA](https://forum.infinityfree.com/u/HELPINDIA)
#### Post date: [December 13, 2021, 4:49pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/10 "2021-12-13T16:49:42Z")

</div>

choose A instead of Cname in TYPE

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 4:50pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/11 "2021-12-13T16:50:32Z")

</div>

Ok, got it!  
Just put the domain name for **value**

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 5:00pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/12 "2021-12-13T17:00:19Z")

</div>

OK, so this is what I have.

Saved it. Waiting to propagate. Let’s see if it works.

 ![dns2](https://forum-cdn.infinityfree.net/original/3X/c/e/ce50e04c98d0d19a386b04f166b5552cea2a6d11.png)

---

<div class="post-metadata">

### Author: ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)
#### Post date: [December 13, 2021, 5:16pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/13 "2021-12-13T17:16:39Z")

</div>

You should have two A records setup like below.

RECORD #1  
TYPE: “A”  
CONTENT: “@”  
NAME: IP address from [app.infinityfree.net](http://app.infinityfree.net/)

RECORD #2  
TYPE: “A”  
CONTENT: “www”  
NAME: IP address from [app.infinityfree.net](http://app.infinityfree.net/)

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 13, 2021, 5:38pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/14 "2021-12-13T17:38:01Z")

</div>

You sure? Admin mentioned in the 4th reply, that www should be CNAME.

I’ll try A and IP address

---

<div class="post-metadata">

### Author: ![jaikrishna.t](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/jaikrishna.t/32/57109_2.png) [@jaikrishna.t](https://forum.infinityfree.com/u/jaikrishna.t)
#### Post date: [December 13, 2021, 5:40pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/15 "2021-12-13T17:40:07Z")

</div>

It should be CNAME unless you want to host something else on `www`

---

<div class="post-metadata">

### Author: ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)
#### Post date: [December 13, 2021, 6:26pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/16 "2021-12-13T18:26:53Z")

</div>

> [@ZFR7777777](#):
>
> that www should be CNAME.

It can be either or. It does not matter which one you use for the www.

---

<div class="post-metadata">

### Author: ![ZFR7777777](https://forum.infinityfree.com/letter_avatar/zfr7777777/32/5_5575768a8748004e209b776fc1b2916d.png) [@ZFR7777777](https://forum.infinityfree.com/u/ZFR7777777)
#### Post date: [December 14, 2021, 9:44pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/17 "2021-12-14T21:44:14Z")

</div>

OK, thanks everyone for their help.

The website works.

---

<div class="post-metadata">

### Author: ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)
#### Post date: [December 21, 2021, 9:45pm UTC](https://forum.infinityfree.com/t/dns-setup-for-a-custom-domain/55742/18 "2021-12-21T21:45:15Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
