[How-To] Flush DNS Cache

If you are a developer who often has to test same application deployed on different servers, the various options you have are

1.) Modify your HOSTS file to point to a new IP. You can learn more about modifying HOSTS file by reading previous posts on HOSTS file ( Microsoft Windows: More fun with the HOSTS file and Block Websites of your choice without any Software)

2.) Modify the DNS Entry of your Website. This is useful if you have testers who are not technically savvy doing the testing. In such a scenario all you need to do is modify the DNS entry and the new IP is reflected as soon as the change happens.

However, if you are having issues with the DNS IP Resolution and if even after a change on your DNS Server, the new IP is not getting reflected, its time to Flush the DNS Cache. 

DNS Resolution of My Website is Cached? How can i Clear this Cache?

Follow the Steps below

1.) In your windows machine, open the command window by going through Start –>Run and type Cmd.

Initiate the command window

Image: Initiate the command window

2.) At the Command Prompt, type ipconfig /flushdns as shown below in the figure.

Flush out DNS Cache

Image: Flush out DNS Cache

3.) Your DNS Cache is now flushed. What this means is, that your computer will now make a new request to your DNS Server for getting the IP Address. 

The above listed trick lets you flush the DNS Cache from the local resolver of your computer. However, the DNS Entry might still be cached at the DNS Server. 

How Can i Stop the Local DNS Resolver from Caching at All?

Yes. If you make frequent changes to your IP Address and would like to keep the DNS Cache Resolver away from Caching the entries, you can stop the service by typing net stop dnscache at the command prompt.

In order to start the service again, type net start dnscache.

Starting and Stopping the DNS Local Resolver Caching.

Image: Starting and Stopping the DNS Local Resolver Caching.

You can even tweak Windows Registry to modify the DNS Caching behaviour

You can modify the behavior of the Microsoft Windows DNS caching algorithm by setting two registry entries in the

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters registry key.

The MaxCacheTtl represents the maximum time that the results of a DNS lookup will be cached. The default value is 86,400 seconds. If you set this value to 1, DNS entries will only be cashed for a single second. MaxCacheTtl needs to be a new DWORD.

MaxNegativeCacheTtl represents the maximim time that the results of a failed DNS lookup will be cached. The default value is 900 seconds. If you set this value to 0, failed DNS lookups will not be cached. MaxNegativeCacheTtl needs to be a new DWORD.

How Do I Flush DNS Cache in Linux?

In Linux, DNS Cache is managed by a service called nscd. To restart the nscd daemon, use the command `/etc/init.d/nscd restart`.

 

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.


Advertisements

List of Major IP Addresses Blocks By Country

Nirsoft, the creators of WirelessKeyView, software which can help you get your Wireless Keys in case if you have forgotten them, have now released the Major IP Addresses Blocks by Country. 

For countries in europe and in the middle east, the name of the company/Internet provider that own these IP blocks is also displayed. In order to show only the major IP blocks, only IP blocks with 4096 addresses or more were added to the list. For United States, only IP blocks with 65536 addresses or more were added to the list.

You can access the complete list on Nirsoft’s Website.

What is an IP Address? How can i find my IP Address?

IP Address is in short, the address of your computer. Using this address it is identified over the internet and your local network. Since these numbers are usually assigned in country- or region-based blocks, an IP address can often be used to identify the location from which a computer is connecting to the Internet.

If you are interested to know your IP Address, read What’s your IP Address?

 

How to Use this List? Can you give some Example Usages?

Well, to take practical scenarios, First example to take from this list is that it can be used to identify the location of a particular IP. This could be the IP of the person who sent you a mail on your Yahoo Mail account or IP of the person who sent you a mail on your Gmail account

The other example usage can be testing your web application for geo-targeting. If you have a web application which geo-targets content based on the end user’s IP address, you can use any of the IP Address listed against the country of your choice and test your Web Application. This can be done by enabling and Modifying the X-Forwarded-For header in the HTTP Request. To do this, you can either use Fiddler or Modify HTTP Headers.  

The X-Forwarded-For (XFF) HTTP header is a de facto standard for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or load balancer. This is a non-RFC-standard request header which was introduced by the Squid caching proxy server’s developers.

Also, if you are a geek, you can develop your own script to figure out the location of a particular IP Address using the IP Address Blocks given in the list released by Nirsoft.

Can you List any other website which helps me find the location of a given IP Address?

Yes. Try out IP2Location

 

Also ReadHow does Google knows if you are a Adsense client and clicking on your own ads?

How-To Send Free SMS using Yahoo Mail?

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav Pandey

How does a DNS work?

I earlier wrote about OpenDns and how it can help you stay ahead while making a dns query. But interestingly, i met someone recently who quite didn’t understand the whole DNS and the resolution thing, for him and for all those of you who might be interested, this is the post.

Have you ever thought about how the website address you type in the browser address bar gets resolved to the IP address. This post describes the way Domain Name Servers resolve the web address to IP Address.

When you enter the address of a website into your web browser, the browser tries to identify the IP address of the server hosting this website. Follow the steps below to identify what happens behind the scenes.

1.) The user enters the web address for Technofriends (www.technofriends.in) ( URL –> Universal resource locater) in the browser’s address bar.

Structure of DNS

2.) The browser then contacts the local nameserver ( usually assigned in the IPCONFIG) and asks for the IP address of the webserver.

Name Servers through IPCONFIG

3.) If the local nameserver has this information in its cache, it passes this on to the client browser. If not, it sends back the reference to the Root DNS Servers.

4.) The client browser then gets in touch with the ROOT DNS Server and asks for the IP address of http://www.technofriends.in . The Root DNS server, then gives back a reference for .in DNS servers.

DNS

5.) The client then gets in touch with the .IN DNS servers for the IP of http://www.technofriends.in

6.) The .IN Server then returns a reference to the name server of TECHNOFRIENDS.IN

7.) Client then contacts the TECHNOFRIENDS.IN nameserver to get the IP of http://www.technofriends.in.

8.) The TECHNOFRIENDS.IN nameserver returns the IP Address of http://www.technofriends.in.

9.) Client browser then connects to the IP Address and gets the content.

You can get the DNS resolution steps of the website using DIG in Unix or NSLOOKUP in windows. You might even try out the web based dig tool available here.

Also read: What’s your IP Address?

Open DNS: A big DNS Cache

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

What was HOT: 1 Month back on Technofriends

This is a retro roundup of the posts that got maximum reader attention exactly one month back on Technofriends.

Tutorial: Find the IP Address of sender in Gmail.

Tutorial: Find IP Address of Sender in Yahoo Mail!

Uncovered: Serious Orkut Security BUG

Windows XP: Speed up Folder Browsing.

Spoofing Explained : Another attempt to cover Hacking fundas

Open DNS: A big DNS Cache

Write a Java Application without a main() method

vConvert.net: Download online videos in multiple formats

Bluetooth hacking: Essential tools.

Access Blocked Websites: The simple way 🙂

Don’t forget to bookmark the blog or better still Subscribe to the blog’s new feed.

Cheers,

Vaibhav

Open DNS: A big DNS Cache

To begin with, i thought of writing a little about DNS and then moving on. So here I am, beginning with a very basic question ” What is DNS ? “.

                                                            What is DNS

Ok, having written that, i also need to write the explanation for this question. :). So here you go:

DNS stands for Domain Name System.Whenever we type a URL in our browser, it is first translated into computer translated numbers. In short, DNS is a database system that translates a fully qualified domain name into an IP Address.

Usually, most networks use the DNS servers provided by their ISP’s or run their own small DNS Server.

I was looking for a DNS server which really gives a boost to my internet speed and also adds some crispiness to my internet broadband connection. Thats when i found OpenDNS. OpenDNS is free, fast and secure DNS Server. As per the website:

OpenDNS is a better DNS, free to all. OpenDNS uses its distributed network of DNS servers to speed up your Internet experience, increase reliability, improve security and make DNS smarter for users all over the world.

OpenDNS

OpenDNS is a zero downtime service. Personally, i have been liking it since the day i started using it. Also, the thing that impresses me about OpenDNS are the features that come along with it. Once the setup is complete ( which is as simple as changing the IP on your computer ), OpenDNS blocks unsafe websites and also fixes up the mistyped domain names.

The key question that might and rather should come to anyone’s mind is ” How can OpenDNS be free?”. The answer to this key question is; OpenDNS makes money by placing advertisements on pages for domains which do not exist.

Try out OpenDNS by clicking here.

If you find the service interesting, do let me know.

Cheers,

Vaibhav

Tutorial: Find IP Address of Sender in Yahoo Mail!

In my previous article, i had written about Finding IP Address of the sender in Gmail. Many readers have replied back to me to write about figuring the IP Address of sender in Yahoo Mail. In this tutorial, i shall be writing about the trick to get the IP Address of sender in Yahoo Mail.

Also Read: (Tutorial: Find the IP Address of sender in Gmail.)

The IP Addresses for all the sender mails are readily available in the header information. We have already discussed the way to track down the mails sent to Gmail. In order to get the information out from your Yahoo Mail, please follow the steps mentioned below.

For Users using New Yahoo Mail:

IP Tracking

  1. Login to your Yahoo mail and open the mail for which you wish to know the Sender.
  2. Click on Compact Header/Standard Header, this presents a drop down menu. Select,Full Header from the drop down menu.
  3. A window Pops up with the entire header details.
  4. Look for the term Received: from [eg: Received: from 216.248.197.88 (EHLO mx1.info.brainbench.com) (216.248.197.88) ]. The IP Address mentioned is the sender IP Address.
  5. Also importantly, there are times when you might find multiple Received: from entries, in that case, please select the last one as the valid choice.

For Users using Yahoo Mail Classic:

Yahoo IP Tracking

  1. Login to your Yahoo mail and open the mail for which you wish to know the Sender.
  2. If you do not see the headers above the mail, you need to enable them. In order to do so follow these steps:
  • Click on Options link on the top-right corner.
  • In the Mail Options page being displayed now, click on the link called General Preferences.
  • Scroll down to Messages section where you have the Headers option.
  • Make sure that Show all headers on incoming messages is selected.
  • Click on the Save button.
  • Go back to the inbox and open the mail for which you wish to know the sender’s IP.

3. You should now be able to see headers in the mail.

4. Look out for header with title Received. The IP Address is listed in the column (e.g. from 216.248.197.88).

Note: There are times when you might find multiple Received: from entries, in that case, please select the last one as the valid choice. If there are no instances of Received: from with the IP address, select the first IP address in X-Originating-IP.

Let me know if you have any doubts getting the IP Address.

Cheers,

Vaibhav

6 Tips To Protect Your Online Search Privacy

Google and other search engines have been doing it since ages… Yes, you guessed it right. I am talking about collecting your personal information. However, there are for sure ways to ensure that you come out of this big mess without getting hurt. Tio has written a detailed article on this topic describing the ways to protect your online search privacy.
Below are the tips which are discussed in this article.

  1. Don’t put personally identifying information in your search terms.
  2. Don’t use your ISP’s search engine
  3. Don’t login to your search engine or related tools
  4. Block “cookies” from your search engine
  5. Vary your IP address
  6. Use web proxies and anonymizing software like Tor

Although, Tio does discusses these tips in full length, but one should be aware that implementing these methods only creates a shield. It doesnt actually guarantee you full safety.

Read the full blog post here
In the end, Play safe is the word i would like to utter before ending this post 😉

Cheers,

Vaibhav