Using BIND9 as a Caching Server, is there a way to set the expiration of the cached items/names?How do I do a...

Why does 0.-5 evaluate to -5?

Which RAF squadrons and aircraft types took part in the bombing of Berlin on the 25th of August 1940?

How can I prevent an oracle who can see into the past from knowing everything that has happened?

How do you funnel food off a cutting board?

Is there a file that always exists and a 'normal' user can't lstat it?

Could a warlock use the One with Shadows warlock invocation to turn invisible, and then move while staying invisible?

How vim overwrites readonly mode?

Can you determine if focus is sharp without diopter adjustment if your sight is imperfect?

The No-Straight Maze

Not a Long-Winded Riddle

What species should be used for storage of human minds?

How to write cases in LaTeX?

How to create a label containing values from different layers in QGIS

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Why didn't the 2019 Oscars have a host?

How do you get out of your own psychology to write characters?

hrule into tikz circle node

What is the wife of a henpecked husband called?

What is the industry term for house wiring diagrams?

Prevent Nautilus / Nemo from creating .Trash-1000 folder in mounted devices

Coworker asking me to not bring cakes due to self control issue. What should I do?

Can a player sacrifice a creature after declaring that creature as blocker while taking lethal damage?

Taking headphones when quitting job

Do authors have to be politically correct in article-writing?



Using BIND9 as a Caching Server, is there a way to set the expiration of the cached items/names?


How do I do a complete BIND9 DNS Server Configuration with a hostname?Bind9 problems with Ubuntu 12.04 LTSHow can I use bind9 to use my own custom domain in my LAN?Unexpected termination of Bind in Ubuntu 10.04.4 LTSSetup and hosting multiple zones using own Bind NameserverWhy shouldn't one specify FQDN's in some places in BIND config?Network devices can use a bind9 server but the server itself can'tIssues trying to set up internal dns server using bind9 on ubuntu server 16.04dns set up using bind9 behind a routerInstalling specific versions of bind (apt-get)How to resolve a Domain Name













0















My BIND9 is currently running fine but is there a way to set the expiration time/date of the cached names? If so, how?



Thanks in advance guys










share|improve this question














bumped to the homepage by Community 5 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    My BIND9 is currently running fine but is there a way to set the expiration time/date of the cached names? If so, how?



    Thanks in advance guys










    share|improve this question














    bumped to the homepage by Community 5 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      My BIND9 is currently running fine but is there a way to set the expiration time/date of the cached names? If so, how?



      Thanks in advance guys










      share|improve this question














      My BIND9 is currently running fine but is there a way to set the expiration time/date of the cached names? If so, how?



      Thanks in advance guys







      bind caching






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 18 '14 at 16:21









      Abel Melquiades CallejoAbel Melquiades Callejo

      5151617




      5151617





      bumped to the homepage by Community 5 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 5 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          2 Answers
          2






          active

          oldest

          votes


















          0














          The expiration time is known as the "TTL" or time to live. You set this variable in you configuration file, typically /etc/bind/db.local or whatever config file you are using.



          TTL is in seconds, so set it to a lower value, 60x60 = 3600 for an hour for examlpe



          sudo -e /etc/bind/db.local


          Set the ttl:




          $TTL 3600




          and restart bind.



          For additional information see:



          How do I do a complete BIND9 DNS Server Configuration with a hostname?



          and



          https://help.ubuntu.com/10.04/serverguide/dns-configuration.html






          share|improve this answer


























          • I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

            – Abel Melquiades Callejo
            Feb 18 '14 at 16:52













          • I believe so, is there already a line defining TTL ? If so, then yes.

            – Panther
            Feb 18 '14 at 17:01



















          0














          Each DNS record already contains a Time To Live (TTL) value that specifies the number of seconds it may be cached for, and the SOA record for the zone contains the TTL for negative results.



          Whenever a result is forwarded from a DNS that is not the authoritative server for the zone, the TTL is reduced by the time that the result had been cached already.



          For example, when I resolve google.de:



          google.de.              300     IN      A       216.58.205.227


          If I do it again ten seconds later:



          google.de.              290     IN      A       216.58.205.227


          The original TTL of the record was most likely 300, and my provider's DNS cached it after I first asked, and returned the cached result to me on the second iteration.



          So, lifetime is tracked per record.



          When you run your own DNS server, there are two ways for it to resolve names: using a forwarder, or doing a hierarchical lookup.



          When you use a forwarder, your server simply queries another caching server, and will get a cached result with a shortened TTL if the other server already has a copy of that record. There is no way to tell the age of that cached entry, only when it is supposed to expire.



          When you do recursive lookups yourself, you are pretty much guaranteed to get fresh results, at the expense of having to do a lookup for every path component on the way. If your link has a high round-trip time (GPRS or satellite link), it is likely that the original request from the application will time out before your server has had a chance to get the result.



          In either case, you can limit the TTL for cached records on your server using the max-cache-ttl and max-ncache-ttl settings in BIND.



          In a forwarder setup, this will not help much, because all it will do is make your server query the forwarder again, which will reply with the cached value if it is still valid.



          In a recursive setup, this will shorten the time your server caches results — but all results on all levels. So after that timeout has elapsed, it will re-do the full recursive query.



          Generally, DNS administrators take great care to set adequate TTLs on records, for example I will use 60 seconds on the records I use to find my home network, while my servers have a TTL of one day. When I plan to move a server, I will reduce its TTL to an hour on the day before, and to five minutes before I leave for the datacenter, so you will get reasonable TTLs from caches. Second-guessing me will only give you degraded performance as your DNS refreshes entries unnecessarily. If some records are often outdated, that is a configuration problem on the other person's end, not on your side.



          tl;dr: you can, but you shouldn't.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f422675%2fusing-bind9-as-a-caching-server-is-there-a-way-to-set-the-expiration-of-the-cac%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The expiration time is known as the "TTL" or time to live. You set this variable in you configuration file, typically /etc/bind/db.local or whatever config file you are using.



            TTL is in seconds, so set it to a lower value, 60x60 = 3600 for an hour for examlpe



            sudo -e /etc/bind/db.local


            Set the ttl:




            $TTL 3600




            and restart bind.



            For additional information see:



            How do I do a complete BIND9 DNS Server Configuration with a hostname?



            and



            https://help.ubuntu.com/10.04/serverguide/dns-configuration.html






            share|improve this answer


























            • I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

              – Abel Melquiades Callejo
              Feb 18 '14 at 16:52













            • I believe so, is there already a line defining TTL ? If so, then yes.

              – Panther
              Feb 18 '14 at 17:01
















            0














            The expiration time is known as the "TTL" or time to live. You set this variable in you configuration file, typically /etc/bind/db.local or whatever config file you are using.



            TTL is in seconds, so set it to a lower value, 60x60 = 3600 for an hour for examlpe



            sudo -e /etc/bind/db.local


            Set the ttl:




            $TTL 3600




            and restart bind.



            For additional information see:



            How do I do a complete BIND9 DNS Server Configuration with a hostname?



            and



            https://help.ubuntu.com/10.04/serverguide/dns-configuration.html






            share|improve this answer


























            • I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

              – Abel Melquiades Callejo
              Feb 18 '14 at 16:52













            • I believe so, is there already a line defining TTL ? If so, then yes.

              – Panther
              Feb 18 '14 at 17:01














            0












            0








            0







            The expiration time is known as the "TTL" or time to live. You set this variable in you configuration file, typically /etc/bind/db.local or whatever config file you are using.



            TTL is in seconds, so set it to a lower value, 60x60 = 3600 for an hour for examlpe



            sudo -e /etc/bind/db.local


            Set the ttl:




            $TTL 3600




            and restart bind.



            For additional information see:



            How do I do a complete BIND9 DNS Server Configuration with a hostname?



            and



            https://help.ubuntu.com/10.04/serverguide/dns-configuration.html






            share|improve this answer















            The expiration time is known as the "TTL" or time to live. You set this variable in you configuration file, typically /etc/bind/db.local or whatever config file you are using.



            TTL is in seconds, so set it to a lower value, 60x60 = 3600 for an hour for examlpe



            sudo -e /etc/bind/db.local


            Set the ttl:




            $TTL 3600




            and restart bind.



            For additional information see:



            How do I do a complete BIND9 DNS Server Configuration with a hostname?



            and



            https://help.ubuntu.com/10.04/serverguide/dns-configuration.html







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 13 '17 at 12:24









            Community

            1




            1










            answered Feb 18 '14 at 16:41









            PantherPanther

            79.2k14157259




            79.2k14157259













            • I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

              – Abel Melquiades Callejo
              Feb 18 '14 at 16:52













            • I believe so, is there already a line defining TTL ? If so, then yes.

              – Panther
              Feb 18 '14 at 17:01



















            • I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

              – Abel Melquiades Callejo
              Feb 18 '14 at 16:52













            • I believe so, is there already a line defining TTL ? If so, then yes.

              – Panther
              Feb 18 '14 at 17:01

















            I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

            – Abel Melquiades Callejo
            Feb 18 '14 at 16:52







            I'm just using bind as a caching server only. And the only config file I edited was /etc/bind/named.conf.options. The tutorial that I followed was this link. Can I just put the line $TTL 3600 in /etc/bind/named.conf.options? I really appreciate your help man

            – Abel Melquiades Callejo
            Feb 18 '14 at 16:52















            I believe so, is there already a line defining TTL ? If so, then yes.

            – Panther
            Feb 18 '14 at 17:01





            I believe so, is there already a line defining TTL ? If so, then yes.

            – Panther
            Feb 18 '14 at 17:01













            0














            Each DNS record already contains a Time To Live (TTL) value that specifies the number of seconds it may be cached for, and the SOA record for the zone contains the TTL for negative results.



            Whenever a result is forwarded from a DNS that is not the authoritative server for the zone, the TTL is reduced by the time that the result had been cached already.



            For example, when I resolve google.de:



            google.de.              300     IN      A       216.58.205.227


            If I do it again ten seconds later:



            google.de.              290     IN      A       216.58.205.227


            The original TTL of the record was most likely 300, and my provider's DNS cached it after I first asked, and returned the cached result to me on the second iteration.



            So, lifetime is tracked per record.



            When you run your own DNS server, there are two ways for it to resolve names: using a forwarder, or doing a hierarchical lookup.



            When you use a forwarder, your server simply queries another caching server, and will get a cached result with a shortened TTL if the other server already has a copy of that record. There is no way to tell the age of that cached entry, only when it is supposed to expire.



            When you do recursive lookups yourself, you are pretty much guaranteed to get fresh results, at the expense of having to do a lookup for every path component on the way. If your link has a high round-trip time (GPRS or satellite link), it is likely that the original request from the application will time out before your server has had a chance to get the result.



            In either case, you can limit the TTL for cached records on your server using the max-cache-ttl and max-ncache-ttl settings in BIND.



            In a forwarder setup, this will not help much, because all it will do is make your server query the forwarder again, which will reply with the cached value if it is still valid.



            In a recursive setup, this will shorten the time your server caches results — but all results on all levels. So after that timeout has elapsed, it will re-do the full recursive query.



            Generally, DNS administrators take great care to set adequate TTLs on records, for example I will use 60 seconds on the records I use to find my home network, while my servers have a TTL of one day. When I plan to move a server, I will reduce its TTL to an hour on the day before, and to five minutes before I leave for the datacenter, so you will get reasonable TTLs from caches. Second-guessing me will only give you degraded performance as your DNS refreshes entries unnecessarily. If some records are often outdated, that is a configuration problem on the other person's end, not on your side.



            tl;dr: you can, but you shouldn't.






            share|improve this answer




























              0














              Each DNS record already contains a Time To Live (TTL) value that specifies the number of seconds it may be cached for, and the SOA record for the zone contains the TTL for negative results.



              Whenever a result is forwarded from a DNS that is not the authoritative server for the zone, the TTL is reduced by the time that the result had been cached already.



              For example, when I resolve google.de:



              google.de.              300     IN      A       216.58.205.227


              If I do it again ten seconds later:



              google.de.              290     IN      A       216.58.205.227


              The original TTL of the record was most likely 300, and my provider's DNS cached it after I first asked, and returned the cached result to me on the second iteration.



              So, lifetime is tracked per record.



              When you run your own DNS server, there are two ways for it to resolve names: using a forwarder, or doing a hierarchical lookup.



              When you use a forwarder, your server simply queries another caching server, and will get a cached result with a shortened TTL if the other server already has a copy of that record. There is no way to tell the age of that cached entry, only when it is supposed to expire.



              When you do recursive lookups yourself, you are pretty much guaranteed to get fresh results, at the expense of having to do a lookup for every path component on the way. If your link has a high round-trip time (GPRS or satellite link), it is likely that the original request from the application will time out before your server has had a chance to get the result.



              In either case, you can limit the TTL for cached records on your server using the max-cache-ttl and max-ncache-ttl settings in BIND.



              In a forwarder setup, this will not help much, because all it will do is make your server query the forwarder again, which will reply with the cached value if it is still valid.



              In a recursive setup, this will shorten the time your server caches results — but all results on all levels. So after that timeout has elapsed, it will re-do the full recursive query.



              Generally, DNS administrators take great care to set adequate TTLs on records, for example I will use 60 seconds on the records I use to find my home network, while my servers have a TTL of one day. When I plan to move a server, I will reduce its TTL to an hour on the day before, and to five minutes before I leave for the datacenter, so you will get reasonable TTLs from caches. Second-guessing me will only give you degraded performance as your DNS refreshes entries unnecessarily. If some records are often outdated, that is a configuration problem on the other person's end, not on your side.



              tl;dr: you can, but you shouldn't.






              share|improve this answer


























                0












                0








                0







                Each DNS record already contains a Time To Live (TTL) value that specifies the number of seconds it may be cached for, and the SOA record for the zone contains the TTL for negative results.



                Whenever a result is forwarded from a DNS that is not the authoritative server for the zone, the TTL is reduced by the time that the result had been cached already.



                For example, when I resolve google.de:



                google.de.              300     IN      A       216.58.205.227


                If I do it again ten seconds later:



                google.de.              290     IN      A       216.58.205.227


                The original TTL of the record was most likely 300, and my provider's DNS cached it after I first asked, and returned the cached result to me on the second iteration.



                So, lifetime is tracked per record.



                When you run your own DNS server, there are two ways for it to resolve names: using a forwarder, or doing a hierarchical lookup.



                When you use a forwarder, your server simply queries another caching server, and will get a cached result with a shortened TTL if the other server already has a copy of that record. There is no way to tell the age of that cached entry, only when it is supposed to expire.



                When you do recursive lookups yourself, you are pretty much guaranteed to get fresh results, at the expense of having to do a lookup for every path component on the way. If your link has a high round-trip time (GPRS or satellite link), it is likely that the original request from the application will time out before your server has had a chance to get the result.



                In either case, you can limit the TTL for cached records on your server using the max-cache-ttl and max-ncache-ttl settings in BIND.



                In a forwarder setup, this will not help much, because all it will do is make your server query the forwarder again, which will reply with the cached value if it is still valid.



                In a recursive setup, this will shorten the time your server caches results — but all results on all levels. So after that timeout has elapsed, it will re-do the full recursive query.



                Generally, DNS administrators take great care to set adequate TTLs on records, for example I will use 60 seconds on the records I use to find my home network, while my servers have a TTL of one day. When I plan to move a server, I will reduce its TTL to an hour on the day before, and to five minutes before I leave for the datacenter, so you will get reasonable TTLs from caches. Second-guessing me will only give you degraded performance as your DNS refreshes entries unnecessarily. If some records are often outdated, that is a configuration problem on the other person's end, not on your side.



                tl;dr: you can, but you shouldn't.






                share|improve this answer













                Each DNS record already contains a Time To Live (TTL) value that specifies the number of seconds it may be cached for, and the SOA record for the zone contains the TTL for negative results.



                Whenever a result is forwarded from a DNS that is not the authoritative server for the zone, the TTL is reduced by the time that the result had been cached already.



                For example, when I resolve google.de:



                google.de.              300     IN      A       216.58.205.227


                If I do it again ten seconds later:



                google.de.              290     IN      A       216.58.205.227


                The original TTL of the record was most likely 300, and my provider's DNS cached it after I first asked, and returned the cached result to me on the second iteration.



                So, lifetime is tracked per record.



                When you run your own DNS server, there are two ways for it to resolve names: using a forwarder, or doing a hierarchical lookup.



                When you use a forwarder, your server simply queries another caching server, and will get a cached result with a shortened TTL if the other server already has a copy of that record. There is no way to tell the age of that cached entry, only when it is supposed to expire.



                When you do recursive lookups yourself, you are pretty much guaranteed to get fresh results, at the expense of having to do a lookup for every path component on the way. If your link has a high round-trip time (GPRS or satellite link), it is likely that the original request from the application will time out before your server has had a chance to get the result.



                In either case, you can limit the TTL for cached records on your server using the max-cache-ttl and max-ncache-ttl settings in BIND.



                In a forwarder setup, this will not help much, because all it will do is make your server query the forwarder again, which will reply with the cached value if it is still valid.



                In a recursive setup, this will shorten the time your server caches results — but all results on all levels. So after that timeout has elapsed, it will re-do the full recursive query.



                Generally, DNS administrators take great care to set adequate TTLs on records, for example I will use 60 seconds on the records I use to find my home network, while my servers have a TTL of one day. When I plan to move a server, I will reduce its TTL to an hour on the day before, and to five minutes before I leave for the datacenter, so you will get reasonable TTLs from caches. Second-guessing me will only give you degraded performance as your DNS refreshes entries unnecessarily. If some records are often outdated, that is a configuration problem on the other person's end, not on your side.



                tl;dr: you can, but you shouldn't.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 25 at 12:47









                Simon RichterSimon Richter

                1,976119




                1,976119






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f422675%2fusing-bind9-as-a-caching-server-is-there-a-way-to-set-the-expiration-of-the-cac%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    List of shipwrecks in 1808...

                    Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

                    Unit packagekit.service is masked Announcing the arrival of Valued Associate #679: Cesar...