DNS is a system used to convert host names up to 256 characters into IP. The host name, also known as the fully qualified name , indicates both the computer’s name and the internet domain the computer is in. DNS resolves the IP address of a given machine name , allowing machines to communicate with host names on the internet.
What is the Purpose of DNS?
The purpose of DNS is extremely simple, it provides two-sided conversion between easily understandable and usable machine and domain names and machine IP addresses. Since it is not practical to use and remember IP addresses in daily life, the domain naming system is used.
Its main purpose is to respond to inquiries about the domain name or IP number from the network. For this purpose, “Berkeley Internet Name Domain (BIND)” software is widely used. When you want to access a site, DNS determines which site is where, which IP belongs to which computer, and you access it wherever you want.
How DNS Works
The DNS system consists of name servers and resolvers . Computers organized as name servers hold IP address information corresponding to hostnames. Resolvers are DNS clients. DNS clients contain the addresses of the DNS server or servers.
When a DNS client wants to find the IP address corresponding to the name of a computer, the name refers to the server. The name server, that is, the DNS server, sends the IP address corresponding to this name to the client, if there is such a name in its database. Records must be manually entered into the DNS database.
Internet addresses are first separated by country. Expressions such as tr, de, uk at the end of addresses indicate the country where the address is located. For example, en indicates Turkey, de Germany, uk England. A country prefix is not used for US addresses because the US is the country that created DNS and similar applications.
After the Internet addresses are divided into countries, they are further divided into subsections such as com, edu, gov. These expressions correspond to top-level domains in DNS. Top-level domains are as follows:
- Com : Indicates commercial establishments.
- Edu : Indicates educational institutions.
- Org: Indicates non-commercial, non-governmental organizations.
- Net : Shows the networks that take on the Internet backbone function.
- Gov : Indicates government-affiliated institutions.
- Mil : Indicates military institutions.
- Num : Shows where you can find phone numbers.
- Barley : Shows the places where reverse DNS query can be made.
Field names are used in a structure called tree structure, which branches according to a certain rule. Addresses in all countries connected to the Internet, except America, end with the ISO3166 country code of that country. All subdomain addresses in Turkey end with .tr.
DNS Zone Files and Record Types
The file types required for DNS are:
- named.boot: This file is the first file read by the program when DNS starts working
. - named.local:
This file is a file called “loopback” which is used to resolve the address pointing to the machine itself . - named.ca: It contains the addresses of the machines at the top level called “root server (.)”.
- named.hosts: This file is the file where the addresses of the machines in a subdomain running DNS are written, that is, the addresses of all computers working in your area you are responsible for.
- named.reverse: This file is used to convert the IP addresses contained in the named.hosts file, which we explained above, to the names of the machines and is similar in structure to the named.local file.
Keywords Used in DNS Files
Directory: The directory where the specified files will be found is given here.
Cache: Specifies the cache file.
Primary: The name of the main server (Primary Name Server) is given here. The basic information of the domain is found here and the program starts its search first from this server.
Forwarders: If the machine is not found on the main server, it starts searching on the server specified here.
Serial: Here is the serial number and this number must be incremented by one after every change made to the file.
Refresh: Here, it is specified how long it takes for the adjusted files to refresh themselves.
Retry: Here it is specified how long it takes to retry a call.
Expire: It is specified after how long the call will be terminated.
Ttl (Time-To-Live): Indicates that the cache can be kept for the specified time.
Name: The machine name is specified.
Data: IP number is specified.
DNS History
There was no such thing as DNS until 1984. Until that year, name-IP resolution was done with a text file called HOSTS. The names and IP addresses of computers on the Internet were manually recorded in this file. Each computer on the Internet had a copy of this file. When a computer wanted to reach another computer, it would examine this file, if there was a record of that computer in the file, it would get its IP address and communicate.
In order for this system to work well, the contents of the HOSTS file had to always be up to date. In order to achieve this, copies were made periodically by connecting to Stanford University in the USA, where the original file is kept.
But as the number of computers on the Internet increased, both the size of this file began to reach extraordinary dimensions and the connection of computers on the Internet to copy the file began to lock the computers in Stanford.
Another downside to using a single HOSTS file was that; Since all computers are on the same level, it was necessary to ensure that a computer name does not have a duplicate on the entire Internet.
Because of these problems, internet authorities produced DNS in 1984. DNS both put the computer database into a distributed structure and provided a hierarchical structure between computers.
The distributed database in DNS was provided as follows. Computers were classified according to the institutions to which they belonged. For example, a DNS server machine responsible for Turkey kept the list of computers in Turkey (.tr domain). Thus, it was not necessary to keep the information of all computers in the internet environment in one place.
Common DNS Server Software
As explained above, the most widely used DNS Server software is BIND , then there are software with different platforms and features such as Microsoft DNS Service, PowerDNS . Considering the amount of data they process, they consume very little resources. In this way, even on a primitive server with very old and low CPU power, tens of thousands of DNS Zones can broadcast. For detailed comparison, you can check the relevant DNS Server software link.
Why Change DNS?
If you want to change the server, change the IP address of your site and use a distributed service, you can do this through DNS records.
DNS Change to Improve Speed and Security
Announcing the DNS records of your website will significantly increase its accessibility and speed. In addition, with the services you will use such as Cloudflare, you will not feel possible attacks and performance deficiencies.
DNS and Parental Controls
Unwanted and adult content can be blocked through DNS records. BTK, the institution that manages the internet in our country, can block websites via DNS from time to time with court decisions.
How to Change DNS Settings?
What is Reverse DNS?
Reverse DNS is also known as PTR record. It is available in all domain addresses and is generally used in e-mail communication. Required for security reasons.
How to Change DNS Settings?
DNS settings are made through the connected DNS server. You can usually do this through your hosting provider. If the records are changed by an uninformed person, the announcement around the world will be affected.
How to Change Windows 10 DNS Settings?
You can change the Windows DNS settings by following the steps below.
You can change the DNS records from the Network and Sharing Center > Change Adapter Settings > Ethernet Feature Settings > Internet Protocol Version 4 page.
How to Change Mac DNS Settings
Records are added from System Preferences > Network > Location: Add New > Advanced > DNS tab.
How to Change Android DNS Settings?
You can change your DNS records in Settings > Wi-Fi > Wireless > Manage Network Settings > Show Advanced Options > IP Settings = Static >.