You are not logged in.

#1 2014-12-16 19:00:42

gummiflummi
Member
Registered: 2014-12-16
Posts: 2

Clear DNS cache

How can I clear the DNS cache?

When I configure my webserver and change the records, I have to wait the time configured in the ttl of the specific record. I know, that I can change the ttl to a lower value, but the default value is 3 hours, so i have to wait until the time's up.
I checked the DNS records with dig (from dnsutils). dig also shows the remaining seconds until the next refresh (dns server request). And here's my question: How can I refresh it manually? (tried a lot from the internet, but nothing helped)

Thank you guys!

Last edited by gummiflummi (2014-12-16 20:41:53)

Offline

#2 2014-12-16 19:57:36

aiBo
Member
Registered: 2010-11-10
Posts: 50

Re: Clear DNS cache

I don't think that provider of public resolving name servers let you flush their cache. So there is nothing you can do, unless you run your own caching resolving nameserver.

As a temporary workaround you can put the new IP address for the hostname in /etc/hosts until your updated DNS records have found their way onto the public resolver you use.

By the way: Sadly, some ISPs don't care for TTLs and let their recursive name servers cache records much longer for whatever reasons.

Offline

#3 2014-12-16 20:02:26

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: Clear DNS cache

aiBo wrote:

I don't think that provider of public resolving name servers let you flush their cache. So there is nothing you can do, unless you run your own caching resolving nameserver.

Some providers allow a forced refresh, for example opendns. There are also routers with an integrated nameserver which has to be flushed.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2014-12-16 20:43:24

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Clear DNS cache

gummiflummi wrote:

change the records

Woah right there. Why do you need to *change* the records? Shouldn't happen often.

When you know that a change is required soon, what you should do is change the TTL to a lower value than usual, so then *after* you change it, the TTL will expire sooner.

Offline

#5 2014-12-16 22:08:26

gummiflummi
Member
Registered: 2014-12-16
Posts: 2

Re: Clear DNS cache

Thank you all! You're right and the tips helped me. @brebs: I wanted to try diffrent configs and had to wait all the time. That was a bit annoying, but now everything's working fine. Should I increase the TTL back to the old value?

Offline

#6 2015-04-28 07:13:44

pklaus
Member
Registered: 2011-05-03
Posts: 8

Re: Clear DNS cache

brebs wrote:

Woah right there. Why do you need to *change* the records? Shouldn't happen often.

Other than the answer stated (to test DNS settings), you might want to change records for a (self-hosted) DynDNS service. If you want a device to updated its DNS entries while being connected to a shaky cellular network, those changes might occur frequently with changing IPs.

To the original poster: You should always set the TTL to a reasonable setting. If you didn't change the record for the last two years, then maybe a TTL of several hours (or even a day) might be OK. If you want to be able to react more quickly to emergency situations, set it lower. For a DynDNS service, TTLs below a minute might be appropriate.
If you want to test your DNS Server, you can always query it directly (bypassing your ISP's DNS servers) with a command like this (where 1.2.3.4 is the IP of your nameserver):

dig @1.2.3.4 your.entry.example.com

This will usually show you the new settings right after changing.

Offline

Board footer

Powered by FluxBB