+5 votes
74 views
How to know my Linux DNS Server | Command to see my DNS in Linux

in Linux/Unix by (552k points)
reopened | 74 views

1 Answer

+3 votes
Best answer

How to know DNS server in Linux

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 178.33.118.246, 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

 

 

Step 1

In the system terminal we are going to execute one of the following commands:
 cat /etc/resolv.conf less /etc/resolv.conf 
Step 2

In the “nameserver” line we find the Linux DNS server.

 

 

image

 

Step 3

Now we can use the following command to exclusively lookup the DNS server name:
 grep "nameserver" /etc/resolv.conf 
image

 

Step 4

If we use Network Manager, which is a network manager, we have the following command to see the DNS server of the system:

 

image

 

Note
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" 

 

step 5

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:
 say site 
step 6

We can see in the “Answer section” line the DNS details of that site.

 

 

image

 

With these few steps it will be possible to see DNS details in Linux environments using different commands in a complete way.

 


by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Sep 22, 2019 in Linux / Unix by backtothefuture (552k points) | 289 views
+5 votes
1 answer
asked Nov 16, 2022 in Linux/Unix by backtothefuture (552k points) | 84 views
+3 votes
1 answer
asked Dec 6, 2019 in Linux / Unix by backtothefuture (552k points) | 272 views
+5 votes
1 answer
+3 votes
1 answer
asked Feb 6, 2023 in Linux/Unix by backtothefuture (552k points) | 87 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users