The DNS – Domain Name System is used to resolve names to IP addresses and vice versa. In this article, we explain in a simple way how to configure DNS on Linux manually.
The implementation of the name resolution service is carried out by the BIND package or other DNS server packages. This package contains the files needed to configure the DNS and the service called named.
The DNS is structured on two basic points, the organization of the Internet into domains and the distribution of name servers on the network in the form of a hierarchy.
The organization of the Internet into domains avoids the use of the same name by more than one device and decentralizes the registration of networks and equipment.
Domains can be hierarchized by institutions and geographically.
The distribution of DNS servers is necessary because the centralization of a single database containing the information for the conversion of symbolic names into IP addresses would be unfeasible.
The Internet itself was born from a project called ARPANET, created by the American Department of Defense, which recommended a network without a central backbone and without centralized administration, making it virtually indestructible in the case of a computer, or piece of the network became inoperative.
On the Internet, there are several root servers geographically distributed and organized by suffixes. For example, the root servers for the suffix .br are hosted on Brazil.
There are 3 important configuration files for resolving names, already mentioned in the book:
When accessing the Internet through a browser or any other network application, the Linux host follows the following sequence to identify the IP address of the desired Internet address name:
Example configuration for /etc/nsswitch.conf
passwd: files systemd
group: files systemd
shadow: files
gshadow: files
hosts: files dns
networks: files
Example of a basic configuration of the /etc/resolv.conf file:
Search mydomain.com.br nameserver 10.25.12.1 nameserver 200.216.215.5
Example of a basic configuration of the /etc/hosts file:
127.0.0.1 localhost.localdomain localhost 10.25.12.1 www.certificacaolinux.com.br www
It is important that you understand how the name resolution process works, because the /etc/hosts, /etc/nsswitch.conf, /etc/resolv.conf files regulate the configuration of the DNS client.
It’s important to know that the name resolution order in the /etc/nsswitch.conf file affects how name resolution will behave. Once a name resolution issue is found, either on the DNS server or locally in the /etc/hosts file, the host is satisfied and does not use another service.
As a result, the following error cases may occur:
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.