About the prefetch function within bind 9.10.

Hongyi Zhao hongyi.zhao at gmail.com
Sun May 18 05:19:05 UTC 2014


Dear all,

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

------------------
werner at 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 at 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 at 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 <hongyi.zhao at gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20140518/fa8ff55c/attachment.html>


More information about the bind-users mailing list