Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 05-26-2013, 01:45 AM   #1
Registered: Nov 2005
Location: USA
Distribution: Slackware Linux
Posts: 94

Rep: Reputation: 0
Clearing DNS Cache

Just wanted to say, before I started this thread, I did do some research on the Internet as well as the forums.

I'm in the process of migrating a few sites from one server to another, and in the process, instead of changing the DNS records, I modified my hosts file to point to the new server. The new server is running Nginx and several server blocks. I've had to change the hosts file a few times, however this evening the cache seems to have not cleared yet, and I can't find a manual way of clearing the cache. I've even tried rebooting as a last resort.

If anyone has any suggestions, I'd love to hear them. Thanks.
Old 05-26-2013, 02:28 AM   #2
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 853

Rep: Reputation: 259Reputation: 259Reputation: 259
DNS servers cache records for as long as what the record says it should be cached for.

When you go changing hosts the first step is always to change the DNS record's TTL (time to live) to a very short value (eg 1 minute)

That way you avoid your current problem completely.

As for clearing the cache (which can be done manually) you first need to work out if it is even on your end, if it is not local then there is nothing you can do but wait for the record to expire.

First you need to use dig to work out what is really happening

A quick look at my domain via my computer (Some extra output removed) :-
michael@indigo:~$ dig

;; ANSWER SECTION:    3600    IN      A

;; AUTHORITY SECTION:    172800  IN      NS

The answer section gives the details about the record such as the IP address and the TTL (which is the number in the 2nd column) (also the TTL shown here is the TTL that is left on the server that returned the query)

The Authority section lists the DNS servers that host the domain

And the last line shows the DNS server that was actually used to look up the record.

Now if the Server is your own box and it is running named then you can use "rndc flush" to clear the record.

If the Server is some sort of home router device then the easiest way I can cover all of them is to simply say power toggle the thing.

If the Server is your ISP's DNS server or some other 3rd party then there is nothing you can do until the record expires.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] DNS Cache not Clearing? jjern Linux - Newbie 2 11-26-2012 09:54 AM
Clearing the Cache. surisourabh Programming 2 04-14-2009 06:08 AM
clearing cache, web cache on linux varunbihani Linux - General 2 12-08-2005 01:02 PM
DNS cache clearing n.antonio Linux - Software 0 05-11-2003 09:44 PM
clearing cache waxiem Linux - General 1 03-02-2003 10:42 AM

All times are GMT -5. The time now is 08:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration