The Domain Name System is indeed an important part of the Web’s operation since it provides a globally distributed keyword-based redirecting facility. NSLOOKUP is a command-line utility included with Microsoft Windows. In this guide, we will learn about the DNS lookup in the windows system. So, let’s get started.
Search the command prompt from the search bar of your windows desktop. The command prompt will be poped-up. Click on it to launch it. Now the command prompt has been opened, we can start doing a DNS lookup on it. First of all, we need to look at the current settings of our DNS. For that purpose, we have to just use the below ipconfig command followed by the keyword “displaydns” with a backslash sign in our shell and press the Enter key. You will see a long record of DNS settings that are currently held by our system.
Between these DNS settings, we have an entry of www.google.com and its information as shown in the below image. Remember the given data of Google provided in the image.
These settings have also a record about www.youtube.com and its information as presented below. Make sure to remember the provided information on Youtube as well.
As we have a lot of DNS settings in our system, let’s just quickly delete all of them at once. For this reason, use the ipconfig command with the keyword “flushdns” along with the backslash sign and tap the Enter button. You will see that it will flush all the previous entries from the cache as the success message is presenting in the image below.
Check the DNS settings once again using the previous displaydns command as below. You can see, this time it displays nothing because all the entries are flushed out.
As all the DNS data has been flushed, we need to do the DNS lookup now. So, we will ping the Google address first by using the below instruction followed by the Enter key in the cmd shell.
Let’s ping the Youtube address using the below query of ping and hit the Enter key from the keyboard.
Now, let’s have a look at the DNS settings once again by utilizing the displaydns command in the command prompt as below and tap Enter. You can see it shows the Google and Youtube entries in the settings while all the other settings are flushed out. You will see that the settings of Google mentioned below are different from the information provided before the flush of DNS.
The IP address, as well as other details, must be included in DNS data for www.youtube.com and www.google.com. A TTL value typically differs from TTL inside an IP packet, which seems to be another entry inside the DNS buffer. The DNS server that manages the Youtube and Google record sends this DNS TTL value. It is calculated in seconds and also instructs the DNS client about how long to buffer the DNS data to avoid clients lingering on to DNS information which IP addresses ought to update.
Youtube entry is as below. The information regarding Youtube given below is very different from the previous information before the flush action taken place.
Now, it’s time for us to open our system’s host file. For that purpose, search “Notepad” from the search bar of your windows desktop. Right-click on it to open it via the “Run as Administrator” option. Tap on “Run as Administrator”. As the notepad has been opened, click on the “File” menu and select the option of “Open”. It will open a dialogue box on your screen.
Navigate towards the C:\\Windows\System32\Drivers\etc. Select the option of “All Files” from the dialogue box to see all the files residing in the “Etc” folder. You will get a list of some files. Double-click on the “hosts” file to open it in a notepad.
Now, the “hosts” file has been opened in the notepad as presented below with some service records.
Add the below-shown IP address with a name at the bottom of the notepad file. Save your file and quit it quickly.
Let’s check the DNS settings once again to look up the new entry in the host file using the ipconfig command of displaydns, and tap on Enter. The output image is showing the new entry “university” in the cache.
Ping the new entry with our server using the below query and tap Enter.
Let’s flush out the records of DNS settings once again by ipconfig command followed by the Enter key.
Now, check the DNS settings one more time by displaydns keyword in the ipconfig command. Try the below query followed by the Enter button. You can see it doesn’t delete the record of entry “university” even after the flush of DNS settings. This is because we have added this IP address into the host file as host file IP addresses cannot be removed.
Add the below path of a site with the “nslookup” keyword in the command prompt. The title and Source IP of the DNS server, as well as the identity and IP of www.ulster.ac.uk, are shown. You can search for a host’s IP without even connecting with it by using Nslookup.
Let’s use the nslookup command in the command prompt and tap Enter. We would then be in the interactive environment of Nslookup. An arrowhead prompting should appear.
Enter the below site path in the interactive mode and hit the Enter button. You can see it returns many IP addresses.
Retype the same site path and press Enter. This time it returns the different IP addresses for the same site with a different pattern. This implies we can access the site www.google.com by using many different IP addresses.
You can use the below command to check how many of the “A” records are there in your DNS.
If you want to check how many of the “ns” records are there in your DNS system, then try out the below query in the command prompt. The output shows a 1 “ns” record.
If a user wants to check the start of authority in its system, they can do so by the following below query in the command prompt.
If we want to check the mail servers’ “MX” records in our DNS system, we can do so by utilizing the below query.
In this guide article, we have performed every step to do DNS lookup in Windows 10 system. All the instructions are perfectly functional on all previous versions of Windows.