Recent Posts

What Is DNS Cache?

A DNS cache (sometimes referred to as a DNS resolver cache) is temporary info, maintained by a computer's OS, that contains records of all the recent visits and tried visits to websites and different internet domains.

In different words, a DNS cache is simply a memory of recent DNS lookups that your pc will quickly ask when it's attempting to work out a way to load a web site.

Most people only hear the phrase "DNS cache" once it refers to flushing/clearing the DNS cache so as to assist fix an internet connectivity issue. there is a lot of on that at the bottom of this page.

The Purpose of a DNS Cache

The internet depends on the domain name system (DNS) to maintain an index of all public websites and their corresponding IP addresses. you'll think of it as a phone book.

With a phone book, we do not need to memorize everyone's telephone number, that is the solely way phones can communicate: with a number. within the same way, DNS is used so we are able to avoid having to memorize each website's IP address, that is the solely way network equipment will communicate with websites.

This is what happens behind the curtain when you ask your browser to load a web site.

You type in a uniform resource locator like and your browser asks your router for the IP address. The router contains a DNS server address stored, so it asks the DNS server for the IP address of that hostname. The DNS server finds the IP address that belongs to and so is able to know what web site you are requesting, after that your browser will then load the suitable page.

This happens for each web site you wish to go to. whenever a user visits a web site by its hostname, the web browser initiates a request out to the web, however, this request can not be completed till the site's name is "converted" into an IP address.

The problem is that despite the fact that there are a lot of public DNS servers your network will use to try to speed up the conversion/resolution method, it's still faster to own a local copy of the "phone book," that is wherever DNS caches come into play.

The DNS cache tries to speed up the method even more by handling the name resolution of recently visited addresses before the request is distributed out to the web.

How a DNS Cache Works

Before a browser issues its requests to the outside network, the pc intercepts each and looks up the domain name within the DNS cache info. The info contains a list of all recently accessed domain names and also the addresses that DNS calculated for them the first time a request was made.

The contents of a local DNS cache will be viewed on Windows using the command ipconfig /displaydns, with results kind of like this:

In DNS, the "A" record is that the portion of the DNS entry that contains the ip address for the given hostname. The DNS cache stores this address, the requested web site name, and several|and several other} other parameters from the host DNS entry.

What Is DNS Cache Poisoning?

A DNS cache becomes poisoned or polluted when unauthorized domain names or IP addresses are inserted into it.

Occasionally a cache might become corrupted because of technical glitches or administrative accidents, however, DNS cache poisoning is usually related to pc viruses or different network attacks that insert invalid DNS entries into the cache.

Poisoning causes client requests to be redirected to the incorrect destinations, sometimes malicious websites or pages jam-packed with advertisements.

For example, if the record from above had a different "A" record, then once you entered in your browser, you would be taken elsewhere.

This poses a huge drawback for fashionable websites. If Associate in Nursing offender redirects your request for, as an example, to an internet site that appears like Gmail however is not, you may find yourself littered with a phishing attack like whaling.

DNS Flushing: What It does and how to try and do It

When troubleshooting cache poisoning or different internet connectivity problems, a pc administrator may need to flush (i.e. clear, reset, or erase) a DNS cache.

Since clearing the DNS cache removes all the entries, it deletes any invalid records too and forces your pc to repopulate those addresses the next time you are trying accessing those websites. These new addresses are taken from the DNS server your network is ready up to use.

So, to use the example above, if the record was poisoned and redirecting you to a weird web site, flushing the DNS may be a smart start to obtaining the regular back again.

In Microsoft Windows, you'll be able to flush the local DNS cache using the ipconfig /flushdns command in a command prompt. you know it works when you see the Windows ip configuration successfully flushed the DNS Resolver Cache or successfully flushed the DNS Resolver Cache message.

Through a command terminal, macOS users ought to use dscacheutil -flushcache, however, know that there's not a "successful" message when it runs, therefore you are not told if it worked. UNIX system users should enter the /etc/rc.d/init.d/nscd restart command.

A router will have a DNS cache similarly, that is why rebooting a router is usually a troubleshooting step. For a similar reason you may flush the DNS cache on your pc, you'll reboot your router to clear the DNS entries stored in its temporary memory.

Program to Swap Two Numbers in C++

This example contains two different techniques to swap numbers in C++. The first program uses a temporary variable to swap numbers, whereas the second program doesn't use temporary variables.

Example 1: Swap Numbers (Using Temporary Variable)

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int a = 4, b = 10, temp;
  6. cout << "Before swapping." << endl;
  7. cout << "a = " << a << ", b = " << b << endl;
  8. temp = a;
  9. a = b;
  10. b = temp;
  11. cout << "\nAfter swapping." << endl;
  12. cout << "a = " << a << ", b = " << b << endl;
  13. return 0;
  14. }


Before swapping.
a = 4, b = 10

After swapping.
a = 10, b = 4
To perform swapping in the above example, three variables are used.

The contents of the first variable are copied into the temp variable. Then, the contents of the second variable are copied to the first variable.

Finally, the contents of the temp variable are copied back to the second variable which completes the swapping process.

Example 2: Swap Numbers Without Using Temporary Variables.

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int a = 4, b = 10;
  6. cout << "Before swapping." << endl;
  7. cout << "a = " << a << ", b = " << b << endl;
  8. a = a + b;
  9. b = a - b;
  10. a = a - b;
  11. cout << "\nAfter swapping." << endl;
  12. cout << "a = " << a << ", b = " << b << endl;
  13. return 0;
  14. }


Before swapping.
a = 4, b = 10

After swapping.
a = 10, b = 4

Check out these related examples:

Find the non-repeating number in C++

Non-Repeating Element


Find the first non-repeating element in a given array of integers.


Input : -4 2 -4 3 2
Output : 3
Explanation : The first number that does not 
repeat is : 3

Input : 8 3 8 6 7 3
Output : 6


//Simple CPP program to find first non- repeating element.

#include <bits/stdc++.h>
using namespace std;

int nonRepeating(int arr[], int n)
for (int i = 0; i < n; i++) {
int j;
for (j = 0; j < n; j++)
if (i != j && arr[i] == arr[j])
if (j == n)
return arr[i];
return -1;

int main()
int arr[] = { 8,3,8,6,7,3 };
int n = sizeof(arr) / sizeof(arr[0]);
cout << nonRepeating(arr, n);
return 0;


Top High PR Social Bookmarking Sites in 2019

Social Bookmarking sites are online services that allow you to store bookmarks on a cloud-based server, which you can access from anywhere. Users can register on the website to create bookmarks which they can ‘tag’ under various categories. Go through this free social bookmarking sites list 2019 below, these social bookmarking sites are of high DA and ‘can’ be helpful!

What is social bookmarking?

Social bookmarking is the technique to get good backlinks, huge traffic along with branding, promotion and indexing privileges. If you are an SEO or digital marketing guy, you must know about it.

Why use social bookmarking websites?

 You should begin with submitting blog posts or web pages to social sharing sites or social bookmarking sites (sob sites) as it has so many benefits.

  • Bookmarking is the fastest way to index your website or blog post in search engines- Google, Bing, Yahoo, etc.
  • Top bookmarking sites have high PR. If you have backing from them, you will get quality backlinks.
  • Submission to top social bookmarking sites helps to generate new relevant traffic.
  • By submitting on high PR bookmarking sites, your blog post can go viral.
  • It will improve your domain authority.
  • It will reduce the bounce rate.
  • It will help in blog categorization.
You can easily share your blog on the Social Bookmarking sites to generate user engagement. Each of these websites has a different atmosphere, vocabulary, and policies which you need to carefully understand before marketing your content.

High PR social bookmarking sites in 2019

Here I am sharing with you a high pr social bookmarking site list, mostly free bookmarking sites, which I am using regularly for my websites.

Download List From Here: Click Here

Bookmarking websitesPRDAAlexa