Friday, 1 July 2011

A caching-only name server Redux

I must say that I was not very satisfied with this post about a caching-only name server. I had to faff about with the named.ca file and disable dnssec, all in all it just left a very dissatisfied me. Thus, I thought I would had a go with a VM running from my laptop, so that I would have access to internet.

I installed bind:
yum install bind -y
This is the /etc/named.conf file:
options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { any; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

include "/etc/named.rfc1912.zones";
Note changes to default file in bold.

Made sure about the usual suspects:
chkconfig named on
iptables -I INPUT -p udp --dport 53 -j ACCEPT; iptables -I INPUT -p tcp --dport 53 -j ACCEPT;service iptables save
service named start
And these are the results of two dig queries:
dig www.fuji.jp
;; Query time: 953 msec
;; SERVER: 192.168.1.65#53(192.168.1.65)
;; WHEN: Fri Jul 01 17:36:16 2011
;; MSG SIZE  rcvd: 112

dig www.fuji.jp
;; Query time: 0 msec
;; SERVER: 192.168.1.65#53(192.168.1.65)
;; WHEN: Fri Jul 01 17:36:19 2011
;; MSG SIZE  rcvd: 112
This feels a lot more satisfying. In this world of fast internet connections even a name query across several thousand miles takes less than a second, which makes me doubt the usefulness of a caching name server. I'm not saying that I cannot be useful, I'm just saying that it is of no use to me now

No comments:

Post a Comment