If you run a small business or have an idea for a startup, you'll need a domain name for a strong online 1
presence. 2
A domain name is also required to run a website or to have your own email address. 3
Let's dive a little bit into the technical part. 4
Computers communicate using only IP addresses, not domain names; each time you send an email or visit 5
a website using a domain name a request to a DNA server is made. In turn the dns 6
server will respond with a reply indicating the IP address of that domain. 7
The communication with the destination will be based on the IP address, not on the domain name. 8
To show you this, I'll open Wireshark and sniff the traffic. 9
I'm installing Wireshark if it's not already installed. 10
sudo apt update && sudo apt install wireshark 11
I'm waiting a few seconds. 12
And I'm opening it as root. 13
I'm starting capturing traffic. 14
And I'm visiting a website like wikipedia.org 15
Let's see the captured traffic. 16
There is a lot of traffic, but I'm going to filter to see only DNS and HTP packets, so in the filter area 17
I'm writing dns || 18
This is the logical or operator http 19
And we see how the client has requested the address of Wikipedia.org and the server has responded with 20
its ip address. 21
So DNS or domain name system is an essential component of modern Internet communication. 22
It allows us to reference computers by names instead of IP addresses. 23
A domain can represent one or more IP addresses. 24
To see the IP address of a domain, you can ping the domain or use specific commands such as nslookup, 25
host 26
or dig. For example, I'm pinging kali.org 27
And this is the IP address of the domain. We can also run and nslookup kali.org 28
or dig kali.org 29
Look, this is the IP address or host kali.org. These are Linux commands which send DNS requests 30
to the DNS server configured on the system to obtain different DNS information, such as the IP addresses 31
of that domain. 32
Anyone can buy a domain name, and to do so you need to visit a domain name registrar such as GoDaddy 33
or name cheap. 34
Check that the domain you want is free and pay a fee, which is around 10 to 15 dollars per year. 35
Each domain is unique, so you can register a new domain only if it's not already registered. 36
For example, I'm searching for Kali.org 37
And it's already registered since 2002 38
But mykali.dev, is not registered and the registration fee is around 15 dollars per. 39
There are also some free domains means that work exactly like any other domain names; these are domains 40
of small, exotic countries, sometimes just a couple of islands in the ocean. On dot.tk or 41
freenom.com 42
I’m searching for ilovelinux 43
and there are a few domains that can be registered free of charge. 44
There's a big chance that the domain will be already registered when you watch this video. 45
So if you want a .tk, .ml, or a .ga then go ahead and register one. 46
Btw .tk comes from Tokelau, a group of three tropical coral islands, with a capital that rotates 47
between the islands each year. 48
Officially, Tokelau is part of New Zealand; .ml domains belong to Mali which is an African 49
country, and .ga to Gabon which is another African country. 50
Now, let's suppose you have already registered your own domain, a paid or a free one. 51
What's the next step is to run a service like a web or an e-mail on that domain? 52
You need to host the domain on a DNS server and host the website on a Web server or run an e-mail server. 53
Registering a domain name alone only gives you the right to use that particular domain name for a specific 54
period; the domain should be hosted on a DNS server, which will be called authoritative for that particular 55
domain. 56
All the details about the domain, such as the subdomains like www or the associated IP addresses 57
will be configured on the authoritative DNS servers. For redundancy 58
it's recommended to have at least two such servers. 59
One will be the primary master and the other the secondary master, also known as the slave. 60
Imagine the authoritative service as being the final holders of the IP, the users are looking for. When 61
an Internet user writes the domain name in the browser, a DNS query is sent to the DNS server configured 62
on the user's system. 63
This is, in many cases, the DNS server provided by the service provider. 64
The DNS server will follow some specific steps and get the required information. 65
In this case, the IP address from the authoritative DNS server. 66
So we have to indicate to the registrar where we got the domain from, what is the name 67
and the ip address of the authoritative DNS server that will host our domain. We'll run the authoritative 68
DNS server on the Ubuntu VPs that runs in the Digital Ocean cloud 69
so that will be the IP address that should be set at the register. 70
If you got a free domain, you have to specify the IP address and the name of the authoritative server 71
when you register the domain. I'm clicking get it now. 72
I'm going to check out. 73
I'm clicking on Use DNS. 74
Use your own DNS, here will be the name server like NS1 from nsr1.ilovelinux 75
.tk and here the ip address of the authoritative DNS server. 76
So the ip address of the droplet. 77
this one! 78
And the second server, a second name and another IP, if you have a second server; if you don't 79
have, you can write the same IP address. 80
I'm not continuing because I've already registered a domain name for this lab @namecheap.com and that's 81
crystalmind.academy 82
If you take the domain from another registrar, you should follow similar steps. 83
In general, the registrar has comprehensive help on how to do it. 84
So after logging in to namecheap.com, I'm going to domain list and there will be my domain and I'm 85
clicking on Manage 86
Then I'll go to Advanced DNS. 87
And the Personal DNS server. 88
I'm clicking on Add Name server. 89
And I'll add a personal DNS server. 90
This means adding a host and an IP address. 91
It's common for the host name to be ns1, 92
name server 1 for the primary master, and ns2 for the secondary master; I'm choosing this one and I'm 93
writing the IP address of the Ubuntu VPs that's running in the Digital Ocean cloud. 94
And Done! 95
Note that is recommended to have a second server to serve as the secondary DNS server for that domain; 96
the secondary DNS server is authoritative for the domain as well and is also known as the slave DNS 97
server, the first one being the primary or the master server. 98
For this lab, I don't have a second DNS server, although in a production environment it is highly 99
recommended. And because namecheap requires two authoritative DNS servers for the domain I'll add a second 100
host with the same IP address. 101
And it's done. 102
You can check the servers by searching the standard name servers. 103
In the second step, I'll set these servers as being authoritative for my domain, so I'm going to domain. 104
Name servers. 105
Custom DNS. 106
And I'll add both name servers created in the previous step, ns1.crystalmind.academy 107
and ns2. crystalmind.academy 108
And I'm saving the settings; if you buy a second domain and want it to be hosted on the same authoritative 109
DNS server, just add these name servers as the custom DNS servers for that domain. 110
It's not necessary to add the personal DNS servers again in the advanced DNS tab. 111
If you get the domain from another registrar like GoDaddy.com, you'll follow similar steps. 112
And that's all for the moment! 113
Now, any DNA Querry for the crystal.mind.academy domain will reach the name server called 114
ns1.crystal.mind.academy or ns2.crystal.mind.academy, which has the IP address 115
we have provided in the advanced DNS page. That's the IP address of the Ubuntu Droplet. 116
Also note that when you update the name servers for a domain, it may take up to 24 hours for the change 117
to take effect. 118
This is called DNS propagation. 119
In other words, it is a period of time 120
Internet service nodes across the world take to update their caches with the new DNS information 121
of your domain. 122
So if you've just got a new domain, don't expect to use it immediately. 123
Wait a few hours for the name server changes to propagate. To check you for the information about the 124
authoritative DNS servers was updated run dig -t ns and the domain. 125
crystalmind.academy 126
It will display the authoritative DNS servers for that domain. 127
I've changed the servers 5 minutes ago, so the information was not updated, but in a few hours 128
I'll see here ns1.crystalmind.academy and ns2.crystalmind.academy 129
In the next lectures, we’ll install the Bind DNS server on the Ubuntu VPS and then configure it to be 130
authoritative for the crystalmind.academy domain.