The Domain Name System (DNS) plays an essential role in the success of Internet and the World Wide Web since it serves as a central directory service for network addresses. The network of DNS servers (also known as name servers) distributed worldwide ensures that the names of individual network users and network applications like example.org are detailed in IP addresses which are based on computer readable numbers (and vice versa). to always be sure to reach the right computer or the desired website, even without knowing the real IP.
However, in certain situations (in case of name resolution problems for example) , it may be wise to lookbehind the scenes and look for the IP address for a domain name or the domain name for an IP address . To do this, the nslookupprogram, installed by default on Windows, macOS and Linux, is a useful tool.
- What is nslookup?
- Why use nslookup?
- How nslookupworks under Windows, Linux and macOS?
- nslookup: examples of use of interrogation service
- DNS server query in browser with nslookuponline tools
What is nslookup?
nslookupis a simple but very practical command line tool which is mainly used to find the IP address of a specific host or the domain name of a specific IP address (reverse DNS lookup). nslookupcan be run in the command line interface of the operating system used. Windows users start the service from the command prompt , Unix users from the terminal . In addition, there are now a number of web services that allow you to use nslookuponline.
the name nslookupmeans n ame s erver look up , which can be translated as "check the server name.
nslookupobtains the corresponding address information directly from the DNS cache of the name servers. Two different modes are available to the user: in non-interactive mode , the tool inspects by default the es DNS resource records (i.e. address entries in the DNS cache) stored in the local name server. This mode is particularly suitable for simple queries in which a single entry must be searched for a domain. If you wantuse a different DNS server to search and run more complex search processes, you will need interactive mode which starts by launching the command line interface separately.
unlike many other interfaces On the Windows / DOS command line, nslookuphas a "case-sensitive with -q" parameter, that is, the use of lower and upper case letters is relevant.
Why use nslookup?
There are several scenarios that lead to the use of nslookup. The command line interface is an important tool, especially for resolving D errorsNS. A search for information is primarily to find the cause of the problem. For example, if you are using a Windows server and have a problem with the native Active Directory LDAP directory service, you can use nslookupto quickly and easily check if all associated servers are properly resolved in the system. domain names . In general, the program is particularly useful when there are different subdomains , especially when it comes to checking them and when connection problems actually exist.
Another common usage scenario is the search for perfect mail servers ( SMTP , POP, IMAP) for the desired domain. In this case, nslookupdetermines the servers in question using the MX records ( M ail e X change) which belong to the domain of the provider of 'E-mail. These entries contain the IP addresses and names of the providers' servers, which need only be specified when configuring the email client to improve email routing .
How it worksionize nslookupunder Windows, Linux and macOS?
nslookupon Mac, Windows or Linux, open the command line of the respective operating system. You will then find the two modes already briefly listed for using the DNS tool for your own purposes:
- Interactive mode : start nslookupwith the command of the same name then add the parameters separately
- Non-interactive mode : enter directly the command nslookupand the desired parameters
The choice of procedure to apply also depends on your expertise. If the required parameters are known, there is no reason not to perform the DNS server query in one step (if the DNS server should not be changed). Novices must first familiarize themselves with the service: it is easier to cget started by starting nslookup, then taking the syntax and parameters step by step . The options available in this mode can be called with the command "help.
To call the nslookupcommand menu, the service must be active
To quit nslookupafter the request, simply execute the command" exit or close the command line. The key combination [CTRL ] + [C] also works.
nslookup: examples of using the service interrogation
If you launched nslookupin one stepeg, the command line is waiting for other commands. Users have the option of performing queries with the standard configuration or setting individual options . For the first method, simply enter the domain name for which the IP address is to be sought (or vice versa) in the command line and confirm the selection with the Enter key. Thus, nslookuppresents the following result for the search of the address of the example.org domain:
If nslookupdisplays in the query" Server: Unkown, this means that the reverse lookup zone is not configured correctly
In this case, an " unauthorized reply was returned, since the local DNS server could not respond to the request itself, but had to contact one or more other name servers. The contents of the nslookupresponse are the IPv4 addresses (four digits) and IPv6 (longer, separated by colons) of the example domain.
You will find two examples here below for nslookuprequests configured individually in interactive mode .
Retrieve specific address types from resource records
Basically, nslookupis designed to query IPv4 and IPv6 addresses. However, as mentioned above, the command line tool can also retrieve information from other types of addresses in a domain by providing access to DNS entries . To do this, the user must firstdefine ("set) the desired type (" type) before entering the domain name in the command line. Here is what the corresponding nslookupcommand syntax looks like:
set type = ADRESSTYP
The desired request type is entered under "TYPE D 'ADDRESS, where the following types can be used, among others:
| nslookupsettings || Requesttype|
| A || IPv4 address |
| AAAA || IPv6 address |
| MX || Name (s ) domain of the Mail Exchanger |
| NS || Domain name server |
| PTR || "Pointer" request (displays the host name (s) on an IP address ) |
| SOA || Request" Start of Authority (information on DNS zone management) |
If you call the MX record for a domain with nslookup, the network tool returns the responsible mail server (" responsible mail addr).
Change DNS server for precise results
By default, nslookupcontacts the local DNS server, which is usually provided by the router or internet service provider , however, if you use it for the query, the results may not always be accurate. because the server you are looking for is not listed in the local name server cache , for example. However, the command line tool allows youand select the DNS server on which the query is to be executed. If you take the server that is linked to the corresponding domain, you even get authorization replies . The first step is to find the assigned name server (s) by defining the type of query "NS and by displaying this DNS entry by entering the domain name:
set type = NS example.org
nslookupprovides two possible name servers (" a.iana -servers.net and "b.iana-servers.net) for this example, as shown in the following screenshot:
Since the example.org domain name is managed by IANA for documentation purposes, nslookupdisplays the servers of IANA names for the DNS server query launched
One of the two name servers presented must now be set as default server to make requests run in the future. The corresponding command consists of the "server" parameter and the name of the desired server . These two commands are possible for the nslookupexample chosen:
In the last step , the user changes the request type, which is always configured for the search by name server, by the desired address request such as "A for the domain," MX for the IP control of the mail server or "ANY for full control (used here):
set type = ANY
If you enter example.org again to start the query, nsklookup provides DNS information details on the example domain, the name server selected as the p serverdefault (here: a.iana-servers.net) serving as a source of information:
Behind the unknown types 46 and 48 ("Unknown) hides a digital signature (DNSSEC) and the corresponding public key.
This time, the precise authorization of the response shows, among other things, the two already known nameservers and the primary name server from which DNS information is actually obtained.
Query from the DNS server in the browser with the nslookuponline tools
For querying DNS servers with nslookup,the tool does not have to be running on your own system. There are various applications on the Internet that provide the corresponding resources . In this case, the control of the IP address or the domain name takes place on another computer, from your own browser. Two examples of these nslookupweb applications are ping.eu and centralops.net .
ping.eu is limited to the basic functionality of nslookup. After entering an IP address or host name, the tool provides the corresponding equivalent:
ping.eu's nslookupservice allows up to ten DNS queries per minute
With the centralops.net tool , nslookupcan also be used online in interactive mode. This allows users to enter the name server of their choice, change the port, or specify the type of query instead of the provider's default DNS server. This allows, for example, to obtain authorized responses as in the nslookupexample above.
You can make up to 50 free requests per day on the nslookupservice from centralops.net. Paid users receive additional units (starting at $ 20 for 1,000 requests).
ping.eu and centralops.net both offeradditional network tools such as Traceroute or WHOIS .