Giter Site home page Giter Site logo

SubSub domain DNS caching about coredns HOT 6 OPEN

mkoyan44 avatar mkoyan44 commented on June 18, 2024
SubSub domain DNS caching

from coredns.

Comments (6)

chrisohaver avatar chrisohaver commented on June 18, 2024

I would like to point out that coredns caching do not cache sub.sub.domain records.

What is a "sub.sub.domain" record?

I'm running node-local-dns as a caching layer for DNS requests and it's not caching 50% of ordinary traffic.

How are you determining that a response is not cached?

from coredns.

mkoyan44 avatar mkoyan44 commented on June 18, 2024

Sub sub domain example: any.s3.us-west-1.amazonaws.com.

Simply, example.com return preconfigure 300 TTL value when responding to client, but for any.s3.us-west-1.amazonaws.com it 5s.

from coredns.

SuperQ avatar SuperQ commented on June 18, 2024

There is no difference to the cache if a record is top level or any level below that. Records are cached individually, and the cache respects the cache TTL of each record.

You have set a success min TTL of 30s, so any 5s TTL is ignored. This is likely your problem.

Remove the min TTL from your configuration to correctly respect your authoritative TTL.

cluster.local:53 {
  cache {
    success 9984
    denial 9984
  }
}

from coredns.

mkoyan44 avatar mkoyan44 commented on June 18, 2024

I'm checking the caching with the node-local-dns setup. So all requests for cluster.local goes to the coredns instance for cluster internal use, rest to upstream.

In front, I have node-local-dns as the primary DNS server of pods.

.:53 {
  log
  errors
  cache {
    success 9984 300 5
    denial 9984 1 1
  }
  reload
  loop
  bind 0.0.0.0
  forward . 1.1.1.1 {
    prefer_udp
  }
  prometheus :9253
}

I've modified a bit the caching config specifcly MAX_TTL and MIN_TTL. So all original records that fit within the range of (MIN: MAX) will be served from the cache?
Then what's the purpose of denial?

Thx for the clarification.

My end goal was to override the TTL value with my setup so any DNS request generated from pod will be cached with given TTL.

from coredns.

SuperQ avatar SuperQ commented on June 18, 2024

DNS reponses can be success or deny, for example NXDOMAIN. This is called negative response caching.

Please remove the TTL if you don't know what you're doing.

from coredns.

mkoyan44 avatar mkoyan44 commented on June 18, 2024

The point here is that it won't modify the original record TTL when it fits within the (MIN, MAX) range of successful resolve. Node-Local-DNS just caches the record internally for faster lookup.

from coredns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.