How to find DNS from IP address Linux?

How to find DNS from IP address Linux?

To get a record of what ip address we use for our domain name in our website we need a DNS server. A DNS server is the gateway between your computer, phone or tablet and the internet. It is important to point out that this isn't always possible. The internet is a vast network, with a tremendous amount of data being moved around every day. While you are connected to the internet through your ISP (or another country), the servers you are accessing are actually behind a router. The router functions as the gateway between your device and the internet, acting like a switch and routing data from one part of the network to another. Because this is the case, it is very rare to be able to view the data that is passing through this router. Therefore, a DNS server is absolutely necessary to access information on the web.

In this tutorial, I will be showing you how to look at the DNS server records and IP addresses using linux. In the following image, you can see that I have my cable modem pointed to my home server. Now when I run dig @192.168.101 google.com, I will get back an IP address that was assigned to the domain. The next step is to actually get this data into Linux.

Checking dns. We will be using a tool called ifconfig to get these values for us. To run it type ifconfig in the terminal. You will see a lot of information for your network devices including IP address, Subnet mask, and default gateway, in our example that would be 192. This default gateway will be how the rest of the network communicates with your network. You can also use your default gateway to open up your web browser to your default gateway's IP address and type in a web address, such as google. For example, if my default gateway is 192.1 I can go to and see all of the information I am interested in. If you are interested in more information about the different networking terms used in this tutorial, check out this wiki page on Ubuntu. Now that we know all of this information we will now write a simple script to grab the IP address of your DNS server.

Related Answers

What is an example of DNS?

The perfect question for a Webmaster! The Domain...

What is a business domain name?

A business domain, as it were, is the scope of your application, a...

What is an example of DNS?

Understanding DNS. Domain Name Service (DNS) is one of the most important s...