Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About the prefetch function within bind 9.10.

445 views
Skip to first unread message

Hongyi Zhao

unread,
May 18, 2014, 1:19:05 AM5/18/14
to bind-...@lists.isc.org

Dear all,

I compilled and installed the BIND 9.10.0-P1 on my Debian Wheezy box.  See following for detail:

------------------
werner@debian:~$ sudo named -V
BIND 9.10.0-P1 <id:e94d8db1> built by make with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2'
compiled by GCC 4.7.2
using OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
------------------

Now, I setting the prefetch in the named.conf.options by adding the follow line into it:

-----------
prefetch 2 9;
------------

Then restart the named and test it by using the following command:

---------------------
werner@debian:~$ dig ssh.sshcenter.info

; <<>> DiG 9.10.0-P1 <<>> ssh.sshcenter.info
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54538
;; flags: qr rd ra; QUERY: 1, ANSWER: 15, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ssh.sshcenter.info.        IN    A

;; ANSWER SECTION:
ssh.sshcenter.info.    60    IN    CNAME    c-ssh.cloudkvm.net.
c-ssh.cloudkvm.net.    60    IN    A    23.94.104.29
c-ssh.cloudkvm.net.    60    IN    A    199.119.224.224
c-ssh.cloudkvm.net.    60    IN    A    23.226.226.124
c-ssh.cloudkvm.net.    60    IN    A    204.44.87.100
c-ssh.cloudkvm.net.    60    IN    A    192.3.23.197
c-ssh.cloudkvm.net.    60    IN    A    173.254.237.179
c-ssh.cloudkvm.net.    60    IN    A    96.44.134.231
c-ssh.cloudkvm.net.    60    IN    A    23.90.4.124
c-ssh.cloudkvm.net.    60    IN    A    23.92.50.22
c-ssh.cloudkvm.net.    60    IN    A    107.150.4.170
c-ssh.cloudkvm.net.    60    IN    A    199.233.236.200
c-ssh.cloudkvm.net.    60    IN    A    69.197.147.93
c-ssh.cloudkvm.net.    60    IN    A    162.211.227.83
c-ssh.cloudkvm.net.    60    IN    A    192.227.161.20

;; Query time: 1034 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun May 18 13:13:03 CST 2014
;; MSG SIZE  rcvd: 303
-----------------------

As you can see, it takes 1034 msec for the first query.   According to my understanding of the prefetch option,  if I enabled it, then after the first query of a site, then it will always updated automatically into the cache of bind.  So I will always obtain a 0 msec query time for that site after the first query. 

But for my above case, after 60 seconds, if I do the same query, I will get the following results:

-----------------------------
werner@debian:~$ dig ssh.sshcenter.info

; <<>> DiG 9.10.0-P1 <<>> ssh.sshcenter.info
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41322
;; flags: qr rd ra; QUERY: 1, ANSWER: 15, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ssh.sshcenter.info.        IN    A

;; ANSWER SECTION:
ssh.sshcenter.info.    60    IN    CNAME    c-ssh.cloudkvm.net.
c-ssh.cloudkvm.net.    58    IN    A    23.90.4.124
c-ssh.cloudkvm.net.    58    IN    A    192.3.23.197
c-ssh.cloudkvm.net.    58    IN    A    192.227.161.20
c-ssh.cloudkvm.net.    58    IN    A    23.226.226.124
c-ssh.cloudkvm.net.    58    IN    A    23.92.50.22
c-ssh.cloudkvm.net.    58    IN    A    199.119.224.224
c-ssh.cloudkvm.net.    58    IN    A    23.94.104.29
c-ssh.cloudkvm.net.    58    IN    A    199.233.236.200
c-ssh.cloudkvm.net.    58    IN    A    96.44.134.231
c-ssh.cloudkvm.net.    58    IN    A    162.211.227.83
c-ssh.cloudkvm.net.    58    IN    A    107.150.4.170
c-ssh.cloudkvm.net.    58    IN    A    173.254.237.179
c-ssh.cloudkvm.net.    58    IN    A    204.44.87.100
c-ssh.cloudkvm.net.    58    IN    A    69.197.147.93

;; Query time: 2186 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun May 18 13:16:50 CST 2014
;; MSG SIZE  rcvd: 303
-----------------------------

As you can see, the query time is 2186 msec instead of 0 msec.  Any hints on this issue?

Regards
--
Hongyi Zhao <hongy...@gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

Leonard Mills

unread,
May 18, 2014, 1:46:43 AM5/18/14
to Hongyi Zhao, bind-...@lists.isc.org
Taking the CNAME line in the response, please notice that the published TTL is 60 seconds.  Prefetch does not cause named to ignore TTLs.

hth,
Len

Hongyi Zhao

unread,
May 18, 2014, 3:18:21 AM5/18/14
to Leonard Mills, bind-...@lists.isc.org
What do you mean by saying that "Prefetch does not cause named to ignore TTLs"?

I think in my case, I have set the preftch option like this:

--------------
prefetch 2 9;
--------------

This will enable the prefetching for all of the entries with the TTL larger that 2 seconds, (in my case, the TTL is 60 seconds, so the prefetch will be enabled for this entry).  The digit 9 triggering condition for doing the prefetching.  In my case, it should mean that when 51 seconds elapsed for the entry, i.e., 9 = 60 - 51,  the bind will prefetching the record, and then the record will have a full TTL, i.e., 60 seconds for this case again.

Am I wrong about the meaning of the prefetching function of bind or not? 

Regards
Zhao   

Mark Andrews

unread,
May 18, 2014, 3:49:56 AM5/18/14
to Hongyi Zhao, bind-...@lists.isc.org
If there is a query in that 9 second window then named will make a query to repopulate the cache. If there is not a query then the records will expire. You only want to prefetch records that are being queried for regularly. 
_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

bind-users mailing list
bind-...@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Hongyi Zhao

unread,
May 18, 2014, 4:26:33 AM5/18/14
to Mark Andrews, bind-...@lists.isc.org
Yes,  I want to let bind/named prefetch records that are being queried regularly.  In this way, I'll have a set of up-to-date cached records that I've been queried.  Can the prefetch function plus caching mode of bind/named do this for me?

Regards

Phil Mayers

unread,
May 18, 2014, 6:35:43 AM5/18/14
to bind-...@lists.isc.org
On 18/05/14 09:26, Hongyi Zhao wrote:
> Yes, I want to let bind/named prefetch records that are being queried
> regularly. In this way, I'll have a set of up-to-date cached records
> that I've been queried. Can the prefetch function plus caching mode of
> bind/named do this for me?

Re-read Marks reply. "Queried regularly" is not enough. For prefetch to
work, a query must occur in the prefetch window.

With your settings if you do this:

dig
sleep 52
dig
sleep 10
dig

...you should see it work.
0 new messages