What is dns lookup used for

What is dns lookup used for
In this tutorial we will examine what happens when you use DNS to lookup or resolve a domain name to an IP address.

We look at how DNS lookups work, and the exact process involved when looking up a domain name. We follow the client DNS query as it is processed by the various DNS servers in the response chain.

Before we start it might be useful to compare DNS name resolution with a standard question and answer that takes place in everyday life.

Let’s assume you want to know what country Casablanca is in.

Well the first thing you would probably do is ask one of your friends.

So you ask Bob but Bob doesn’t know so he would probably suggest you ask John as he travels a lot, and he might know. ( this is a referral)

So you ask John who again might know and give you the answer or again he might suggest you ask someone else. ( another referral)

This continues until you get an answer.

On the other hand you could also just ask bob, and tell him to get back to you when he’s found the answer. In this case Bob does all the chasing for you.

These exact processes are used when doing a domain name to IP address Lookup using DNS.

Recursive or non Recursive Queries

When a client or DNS server requests a DNS server to resolve a domain name it can use a recursive or non recursive query.

What is dns lookup used for

Recursive queries are generally used by clients i.e. PCs and they tell DNS server to respond only with an answer and not a referral.

is essentially a response that says I don’t know the answer, but try this server it may know the answer.

Non recursive or Iterative queries are used by DNS servers and essentially instruct the other DNS server to return an answer or return the address of another DNS server that may know the answer.

Root Servers

The Domain name structure is an inverted tree like structure starting at the root.

What is dns lookup used for

You can consider it a parent child type relationship with the root being the parent.

The way in which it is constructed is that parents know about their children, but children don’t necessary know about their parents.

Therefore you can only traverse down the tree from the root and not up the tree.

The Root servers are responsible for the Root, and know all of the domain name servers that are responsible for all of the second level domain names. e.g. .com, .net, .org etc

So if you contact a root server looking to resolve the name www.mydomain.com it might not know the IP address itself, but it would know the IP address of a server that knows about the .com domain name.

Because almost all domain name queries need to use the root server there are many of them and they are busy.

Caching

DNS clients and DNS server both use caching to speed up the domain name lookup process and to ease traffic on the root servers.

A cache is a temporary store

If a client queries domain server A looking to resolve www.mydomain.com, and in turn domain server A queries domain server B etc then the result will be stored in a cache on

  • the client ( windows only)
  • domain server A
  • domain server B

If another client needs to resolve the same domain name using server A then server A can respond using the cached result.

You can check the DNS cache on a Windows machine with the command:

ipconfig /displaydns

Domain Name Lookup Examples

The schematic below shows two DNS lookups. In the first Lookup the local DNS server performs an interactive query and is directed down the domain tree to resolve the name.

In the second query the Local server knows the answer and so returns the result from cache.

What is dns lookup used for

Questions

  1. What would happen if client 1 makes a request for www.mydomain.com followed by ftp.mydomain.com
  2.  After about 1 minute Client 1 makes another request for www.mydomain.com .

Answers

  1. The first request would need to go to the root and work down the tree. The second request goes direct to the server responsible for the mydomain domain as the local server already knows who it is.
  2. If the client2 uses Windows then it uses it’s local DNS cache. If client2 is Linux machine then it will need to go the local DNS server, which will return it from it’s cache.

Was This Useful?

What is dns lookup used for

Related Tutorials and Resources:

Please rate? And use Comments to let me know more

Use the DNS lookup tool to find the IP address of any domain name. The lookup results will include the IP addresses in the DNS records received from the nameservers.

How does DNS work?

The domain name system, otherwise known as DNS, is a key component of the Internet. DNS is the resolution of a domain name to an IP address. It can be thought of as a domain lookup, website IP checker, or IP finder, as it searches domains or websites to produce any related IP addresses. Essentially, it converts IP addresses from domain names for the user.

Typical DNS queries are sent through four different server types: the DNS recursor, the root nameserver, the TLD nameserver, and the authoritative nameserver. The domain name system recursor gets the query and communicates with other domain name system servers in order to get the correct IP address.

Once it’s located, the domain name system recursor will send the query to the three other domain name system servers. Next, the root server, designated as the Internet’s domain name system root zone, responds to requests sent in the root zone. A list of authoritative nameservers that correspond with TLDs gets sent back as a response.

The TLD nameserver will then store the second-level domain IP address and release the website’s IP address. The query gets sent to the domain’s nameserver, and finally, the authoritative nameserver can respond to the original domain name system query.

What is DNS lookup used for?

DNS record lookups are used for translating IP addresses and domain names. With the tool, users can find the IP address of a domain name and other information related to domains.

Users can also perform a reverse DNS lookup, which uses pointer records to query an IP address in order to find a hostname. Note that some IP addresses will not return a domain name if there are multiple domains associated with a given IP address. Do a reverse IP lookup to find your IP's domain.

Overview of the forward DNS lookup process

The forward lookup, or simple DNS lookup, is the most commonly used approach to DNS. The forward approach to DNS is simply finding out the IP address of a domain.

People tend to find it difficult to remember long strings of numbers. Instead, it's easier to remember a domain name that uses words, like 'google.com' rather than '8.8.4.4.'

However, electronic devices use streams of 1s and 0s to communicate. The only way for one computer to communicate with another is by unique identification. The method of identification used on the Internet is IP addresses.

Here are the simple steps for DNS resolution:

  1. A user enters a domain name into their Internet browser, like www.whatismyip.com.
  2. The computer sends the domain name as a DNS request to the user's Internet Service Provider (ISP).
  3. The ISP determines if it has the IP address associated with that name.
  4. If it does not, the ISP forwards the request to other providers in an effort to locate the DNS record that contains the data.
  5. Once the record is found, the IP address of the domain is returned to the user.
  6. Now, the user's computer can communicate directly with the server.

How to perform a DNS lookup

To use the DNS lookup command, enter the domain URL into the tool above and select Lookup or press Enter. It will return the IPv4 address records for a domain in a domain lookup.

You can also use the nslookup command to check nameserver types associated with a given domain rather than using the DNS lookup command.

To do a DNS lookup in a Windows computer, go to Start, then Run, and type command to open the command prompt. Type nslookup and hit Enter. Your search will bring back information about your local DNS default server and IP address.

If you're using a Mac computer, go to the Finder menu in the upper right corner and click Go. Find Utilities, then select Terminal. In the box that pops up, type nslookup followed by the IP address or domain you want to query, and then hit Enter. Your search will return the DNS server and IP address of the information you entered.

If you want to know how to look up a domain to find the owner, use a WHOIS Domain Lookup or the  WHOIS IP Lookup tool once you have a domain's IP address. The WHOIS lookup works to check domain owners and identifies the owners of various IP addresses.