if you run a small business or have an idea for a startup you'll need a domain name for a strong
online presence a domain name is also required to run a website or to have your own email address
let's dive a little bit into the technical part computers communicate using only ip addresses not
domain names each time you send an email or visit a website using a domain name a request to a dns
server is made in turn the dns server will respond with a reply indicating the ap address of that
domain the communication with the destination will be based on the ap address not on the domain name
to show you this i'll open wireshark and sniff the traffic i'm installing wireshark
if it's not already installed sudo apt update and then sudo apt install wireshark
i'm waiting a few seconds
and i'm opening it as good
i'm starting capturing traffic
and i'm visiting a website like wikipedia.org let's see the captured traffic
there's a lot of traffic but i'm gonna filter to see only dns and http package
so in the filter area i'm writing dns two vertical bars this is the logical or operator http
and we see how the client has requested the address of wikipedia.org and the server has
responded with xip address so dns or domain name system is an essential component of modern
internet communication it allows us to reference computers by names instead of ip addresses
a domain can represent one or more ip addresses to see the ip address of a domain you can ping
the domain or use specific commands such as nslookup host or dig for example i'm pinging
kali.org and this is the ap address of the domain we can also run nslookup kali.org
or dig kali.org look this is the ip address or host kali.org
these are linux comments which send dns requests to the dns server configured on the system to
obtain different dns information such as the ap addresses of that domain anyone can buy a domain
name and to do so you need to visit a domain name register such as godaddy or namecheap
check that the domain you want is free and pay a fee which is around 10 to 15 dollars per year
each domain is unique so you can register a new domain
only if it's not already registered for example i'm searching for kali.torque
and it's already registered since 2002 but mykali.dev is not registered and the registration
fee is around 15 per year there are also some free domains that work exactly like any other domain
names these are domains of small exotic countries sometimes just a couple of islands in the ocean
on that dot dk or on freename.com i'm searching for i love linux
and there are a few domains that can be registered free of charge there's a big chance
that the domain will be already registered when you watch this video
so if you want a dot tk dot ml or dot ga then go ahead and register one
by the way tk comes from tokyo a group of three tropical coral islands with a capital
that rotates between the islands each year officially tokilao is part of new zealand
that ml domains belong to mali which is an african country and that ga to gabon which is another
african country now let's suppose you have already registered your own domain a paid or a free one
what's the next step is to run a service like a web or an email on that domain you need to
host the domain on a dns server and host the website on a web server or on an email server
registering a domain name alone only gives you the right to use that particular domain
name for a specific period the domain should be hosted on a dns server which will be called
authoritative for that particular domain all the details about the domain such as the subdomains
like www or the associated ip addresses will be configured on the authoritative dns servers
for redundancy it's recommended to have at least two such servers one will be the primary master
and the other the secondary master also known as the slave
imagine the authoritative servers as being the final holders of the ip
the users are looking for when an internet user writes the domain name in the browser
a dns query is sent to the dns server configured on the user's system this is in many cases
the dns server provided by the service provider the dns server will follow some specific steps
and get the required information in this case the ap address from the authoritative dns server
so we have to indicate to the register where we got the domain from what is the name and the
ap address of the authoritative dns server that will host our domain will run the authoritative
dns server on the ubuntu vps that runs in the digitalocean cloud so that will be the ip address
that should be set at the register if you got a free domain you have to specify the ip address
and the name of the authoritative server when you register the domain i'm clicking get it now
i'm going to check out
i'm clicking on use dns
use your own dns here will be the name server like ns1 from name server one but i love linux dot
decay and here the ap address of the authoritative dns server so the ap address of the droplet
this one
and the second server a second name
and another ip if you have a second server if you don't have you can write the same ip address
i'm not continuing because i've already registered a domain name for this lab at namechip.com and the
xcrystalmind.academy if you take the domain from another registrar you should follow similar steps
in general the registrar has comprehensive help on how to do it so after logging in to namecheap.com
i'm going to domain list and there will be my domain and i'm clicking on manage
then i'll go to advanced dns
and the personal dns server
i'm clicking on add name server and dilate a personal dns server
this means adding a host and an ip address it's common for the host name to be ns1
name server 1 for the primary master and ns2 for the secondary master i'm choosing ns1 and i'm
writing the ap address of the ubuntu vps that's running in the digitalocean cloud and done note
that it's recommended to have a second server to serve as the secondary dns server for that domain
the secondary dns server is authoritative for the domain as well and is also known as the slave dns
server the first one being the primary or the master server for this lab i don't have a second
dns server although in a production environment it is highly recommended and because namecheap
requires two authoritative dns servers for the domain i let the second host with the cmip address
and it's done you can check the servers by searching the standard name servers
in the second step i'll set these servers as being authoritative for my domain so i'm going to domain
name servers custom dns and i'll add both name servers created in the previous
step ns1.crystalmind.academy and ns2.crystalmind data academy
and i'm saving the settings if you buy a second domain and want it to be hosted on
the same authoritative dns server just add these name servers is the custom dns servers
for that domain it's not necessary to add the personal dns servers again in the advanced dns
tab if you get the domain from another register like godaddy.com you'll follow similar steps
and that's all for the moment now any dns query
for the crystalmind.academydomain will reach the nameserver called ns1.com
or ns2.crystalmind.academy which has the ap address we have provided in the advanced dns page
that's the ip address of the ubuntu droplet
also note that when you update the name servers for a domain it may take up to 24 hours
for the change to take effect this is called dns propagation
in other words it is a period of time internet service provider nodes
across the world take to update their caches with the new dns information of your domain
so if you've just got a new domain don't expect to use it immediately wait a few hours
for the name server changes to propagate to check if the information about the
authoritative dns servers was updated run dig minus t ns and the domain crystalmined.academy
it will display the authoritative dns servers for that domain i've changed the servers
five minutes ago so the information was not updated but in a few hours i'll see here
ns1.crystalmind. and ns2.crystalmind.academy in the next lecture we'll install the bind dns server
on the ubuntu vps and then configure it to be authoritative for the crystal mind.academy domain