How to get a free domain and DNS hosting?
Tags: webdev, domain, dns, cloudflare
Published: 2021-07-24 07:16:58

## What is a domain?

A domain is a name on the Internet that can represent an organization, an individual, or something else. We associate IP addresses with this name, as a domain is easier to remember than an IP address.

Example of a domain and its IP address

```plain
 https://google.com        74.125.205.113 (IP address valid on the day of publication)
```
Each domain consists of a suffix (com) and a name (any name for example hashnode). There is always a dot between the suffix and the name.

The most common domain extensions

- .com commercial domains
- .net network services
- .org non-profit organizations
- .eu European domain (limited to European Union citizens and organisations)

These domains can be registered by anyone according to the “first come, first served” rule. However, there are domain extensions that can only be registered by certain organizations.

Examples of such domains are:

- .edu for US educational institution
- .gov for US government organizations
- .mil for U.S. military

We register the domain at the domain registration emphasis, some of which are:

- [Namecheap](https://www.namecheap.com/)
- [Google Domains](https://domains.google/)
- [GoDaddy](https://uk.godaddy.com/)
- [Name](https://www.name.com/)

We have to pay a certain amount to register and after the purchase, we become the happy owner of the domain.

## What is a DNS server?

The DNS server allows us to store DNS records. It works in a very simple way to connect an IP address to a domain.

There are several types of DNS records:

- **A record** - a record that has an IPv4 domain address.
- **AAAA record** - a record that has an IPv6 domain address.
- **CNAME record** - Forwards one domain or subdomain to another domain, does not provide an IP address.
- **MX record** - Directs mail to the email server.
- **TXT record** - Allows the administrator to save text notes in a record.
- **SOA record** - Stores administrator information about the domain.
- **SRV record** - Specifies the port for certain services.
- **PTR record** - Provides a domain name in reverse lookup paths.

## Free domain and DNS hosting

When a developer needs a free domain to test a particular service or doesn't have the money to register a domain. Therefore, there are options on how to obtain a free domain.

One commonly known domain that you can get for free is the .tk domain but it is not exactly popular among web service providers (because they are used by many hackers and spammers). So today I’m going to show you another way to get a free subdomain with extensions eu.org.

In my opinion, this is one of the better domains that we can use for websites. Currently, I also use this domain for my sites because I don’t have the money to register a domain.

.eu.org domain can be obtained at [https://nic.eu.org/](https://nic.eu.org/) (I know the site looks very outdated but works 😂).

![First site of eu.org domain register](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eo38fwfv7y3pawa6xxte.png)
 
Let's go to the [website](https://nic.eu.org/arf/en/contact/create/) where we register and get a new account.

![Register form on eu.org](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hh7i72rxihog5vdf1r9o.png)
 

After creating the account, we will receive a message (check spam folder) at the previously entered e-mail address with a link to confirm our user account. Then we can sign up.

Upon registration, we will see all the domains we own (none yet).

![List of domains](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9km52v920rhuyaa1ud9v.png)
 

When we create an account and log in for the first time, a list of domains we own is displayed.

Now the time has come when we can create our domain. We press the “New Domain” button and a page will open where we can create and register our new domain.

![Create new domain form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6no4xn4yon9tpyuzjuu.png)

Fill in the required information. Enter the following two from Cloudflare next to the name of the DNS servers

```plain
NS1 elaine.ns.cloudflare.com
NS2 sage.ns.cloudflare.com
```

![Add DNS nameservers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3y4wx21tlzqgvu11pae9.png)

And press the "Submit" key. This will send a request for a new domain.

We'll receive a domain creation confirmation in a few days after approval, and we'll be able to add it to Cloudflare, to host DNS records.

Cloudflare provides free DDOS protection, free SSL certificates, site rules, caching and minimization of static web files, easy site analysis ...

We simply create an account by going to their [website](https://dash.cloudflare.com/sign-up).

![Cloudflare register page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g60i6mnq9cz2hy8qnb83.png)

And we enter our email address and come up with a secure password. We receive a confirmation email and our account has been created.

We can now add our domain. This is simply done by clicking “Add a Site”

![Add site button click](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmaorjyj2ptf0020jml8.png)

Then in the next window that opens, enter the domain name you want to add.

We choose the package we want to use, it will probably be free, because it is enough for basic needs.

![Select package of Cloudflare domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bl1fct8s1fa9v4owcy8c.png)

In the next step, the wizard itself will automatically scan for existing DNS records and overwrite them if they exist.

![Check for DNS records](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mnjvj1om6bbc25x8lhgr.png)

Finally, we will be prompted to change the DNS server names and that’s it.

![Prompt for update DNS records](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k82lhety090s8pe1ysm6.png)

For eu.org domain, we change the DNS server by simply clicking on our domain.

Find the “Nameservers” key and replace the existing ones with new ones.

![Update DNS nameserver - stap 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dzfg35ooeajorl96vfrw.png)

Now enter the first required server address in the Name1 field in Name2, the other required address.

![Update DNS nameserver - stap 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7v3zcok90zef1hg9b5eo.png)

So, we set up our domain and now we have to wait for all the indirect servers to update (this can take up to 24 hours).

What are DNS records are can be checked with a tool like [What is my DNS](https://www.whatsmydns.net/)

If you want to set up a website for free, read more about the providers in this post [Want to Host Your Website for free?](https://inshaweb.hashnode.dev/want-to-host-your-website-for-free) by @insha 

If you found the post useful, you can comment or share the post with others 🤗. Don't forget like it 😊.