Skip to content

Instantly share code, notes, and snippets.

@ruo91
Created May 1, 2014 08:49
Show Gist options
  • Save ruo91/4d36d100b344c0af388b to your computer and use it in GitHub Desktop.
Save ruo91/4d36d100b344c0af388b to your computer and use it in GitHub Desktop.
CentOS 6.5 - BIND logging
[root@ruo91 ~]# nano /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
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";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel query_logging {
file "/var/named/log/named.log" versions 3 size 10m;
severity debug 3;
print-time yes;
print-severity yes;
print-category yes;
};
category queries {
query_logging;
};
};
zone "." IN {
type hint;
file "named.ca";
};
# ZONE
# Forwared
zone"yongbok.net" IN {
type master;
file "yongbok.zone";
allow-update { none; };
};
# Reverse
zone"1.30.172.in-addr.arpa" IN {
type master;
file "yongbok.rev";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@ruo91 ~]# mkdir /var/named/log
[root@ruo91 ~]# chown -R named:named /var/named/log
[root@ruo91 ~]# chmod -R 777 /var/named/log
[root@ruo91 ~]# service named restart
named 정지 중: . [ OK ]
named 시작 중: [ OK ]
[root@ruo91 ~]# tail -f /var/named/log/named.log
01-May-2014 17:45:57.472 queries: info: client 172.30.1.1#51651: query: www.google.co.kr IN A + (172.30.1.4)
01-May-2014 17:45:57.487 queries: info: client 172.30.1.1#57559: query: apis.google.com IN A + (172.30.1.4)
01-May-2014 17:45:57.512 queries: info: client 172.30.1.1#54304: query: encrypted-tbn0.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:57.526 queries: info: client 172.30.1.1#49556: query: encrypted-tbn1.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:57.538 queries: info: client 172.30.1.1#58256: query: www.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:58.471 queries: info: client 172.30.1.1#51651: query: www.google.co.kr IN A + (172.30.1.4)
01-May-2014 17:45:58.483 queries: info: client 172.30.1.1#57559: query: apis.google.com IN A + (172.30.1.4)
01-May-2014 17:45:58.495 queries: info: client 172.30.1.1#54304: query: encrypted-tbn0.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:58.497 queries: info: client 172.30.1.1#49556: query: encrypted-tbn1.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:58.503 queries: info: client 172.30.1.1#58256: query: www.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:59.473 queries: info: client 172.30.1.1#51651: query: www.google.co.kr IN A + (172.30.1.4)
01-May-2014 17:45:59.480 queries: info: client 172.30.1.1#57559: query: apis.google.com IN A + (172.30.1.4)
01-May-2014 17:45:59.495 queries: info: client 172.30.1.1#54304: query: encrypted-tbn0.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:59.499 queries: info: client 172.30.1.1#49556: query: encrypted-tbn1.gstatic.com IN A + (172.30.1.4)
01-May-2014 17:45:59.501 queries: info: client 172.30.1.1#58256: query: www.gstatic.com IN A + (172.30.1.4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment