To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE
One of the most important factors in the network is the DNS (Domain Name System – Domain Name System) whose task is to convert or translate domain names into IP addresses and vice versa, in this way it is much simpler when accessing a browser to enter TechnoWikis.com and not 22.214.171.124, it would be impossible to learn the IP addresses of all the domains we access..
The DNS is in charge of finding the IP address associated with that domain name and then redirecting us to the correct server where the website is hosted and its operation starts from the root servers to the authoritative servers of each visited domain.
For administration and control tasks, we may need to know what the DNS server is in Linux, so TechnoWikis will explain how to find this information in Linux, in this case Ubuntu, but the process is identical for other distributions..
How to know DNS server in Linux
In the system terminal we are going to execute one of the following commands:
cat /etc/resolv.conf less /etc/resolv.conf
In the “nameserver” line we find the Linux DNS server.
Now we can use the following command to exclusively lookup the DNS server name:
grep "nameserver" /etc/resolv.conf
If we use Network Manager, which is a network manager, we have the following command to see the DNS server of the system:
If we use a system that works with systemd we can execute the following line to see the DNS server:
systemd-resolve --status | grep "DNS Servers"
Finally we can have details of the DNS server of a website, in this case we will use the "dig" command, dig (Domain Information Groper), it is a command with which it is possible to carry out DNS queries with complete details of the indicated site, Thanks to this command we will have details such as the DNS record, IP address, mail records (MX), service records (SRV), and much more, we execute the following syntax:
We can see in the “Answer section” line the DNS details of that site.
With these few steps it will be possible to see DNS details in Linux environments using different commands in a complete way.