Created
May 1, 2014 12:53
-
-
Save ruo91/90c94447e33726c0753c to your computer and use it in GitHub Desktop.
CentOS 6.5 - BIND
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- BIND 설치 | |
[root@ruo91 ~]# yum install bind* -y | |
- named.conf 설정 | |
[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"; | |
- zone 파일 생성 | |
[root@ruo91 ~]# nano /var/named/yongbok.zone | |
$TTL 86400 | |
@ IN SOA ns.yongbok.net. root.yongbok.net. ( | |
2014050118 ;Serial | |
3600 ;Refresh | |
1800 ;Retry | |
604800 ;Expire | |
86400 ;Minimum TTL | |
) | |
@ IN NS ns.yongbok.net. | |
@ IN A 172.30.1.4 | |
ns IN A 172.30.1.4 | |
www IN A 172.30.1.4 | |
ruo91 IN A 172.30.1.4 | |
- Reverse 파일 생성 | |
[root@ruo91 ~]# nano /var/named/yongbok.rev | |
$TTL 86400 | |
@ IN SOA ns.yongbok.net. root.yongbok.net. ( | |
2014050118 ;Serial | |
3600 ;Refresh | |
1800 ;Retry | |
604800 ;Expire | |
86400 ;Minimum TTL | |
) | |
@ IN NS ns.yongbok.net. | |
@ IN PTR yongbok.net. | |
100 IN PTR ns.yongbok.net. | |
100 IN PTR www.yongbok.net. | |
100 IN PTR ruo91.yongbok.net. | |
- 로그 디렉토리 사용자 및 권한 부여 | |
[root@ruo91 ~]# mkdir /var/named/log | |
[root@ruo91 ~]# chown -R named:named /var/named/log | |
[root@ruo91 ~]# chmod -R 777 /var/named/log | |
- 로그 확인 | |
클라이언트에서 DNS 서버를 사용하도록 한후 사이트 접속 해보면 아래와 같이 나옴. | |
[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) | |
01-May-2014 17:46:09.298 queries: info: client 172.30.1.1#56304: query: ssl.gstatic.com IN A + (172.30.1.4) | |
01-May-2014 17:46:11.839 queries: info: client 172.30.1.1#64602: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:46:12.842 queries: info: client 172.30.1.1#64602: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:46:14.848 queries: info: client 172.30.1.1#52389: query: gist.github.com IN A + (172.30.1.4) | |
01-May-2014 17:46:17.265 queries: info: client 172.30.1.1#57414: query: gist-assets.github.com IN A + (172.30.1.4) | |
01-May-2014 17:46:17.273 queries: info: client 172.30.1.1#64873: query: avatars0.githubusercontent.com IN A + (172.30.1.4) | |
01-May-2014 17:46:18.269 queries: info: client 172.30.1.1#64873: query: avatars0.githubusercontent.com IN A + (172.30.1.4) | |
01-May-2014 17:46:18.275 queries: info: client 172.30.1.1#57414: query: gist-assets.github.com IN A + (172.30.1.4) | |
01-May-2014 17:46:19.120 queries: info: client 172.30.1.1#61761: query: www.google-analytics.com IN A + (172.30.1.4) | |
01-May-2014 17:46:19.207 queries: info: client 172.30.1.1#64867: query: collector-cdn.github.com IN A + (172.30.1.4) | |
01-May-2014 17:46:19.916 queries: info: client 172.30.1.1#57449: query: collector.githubapp.com IN A + (172.30.1.4) | |
01-May-2014 17:46:21.600 queries: info: client 172.30.1.1#54984: query: github.com IN A + (172.30.1.4) | |
01-May-2014 17:46:22.880 queries: info: client 172.30.1.1#62972: query: github.global.ssl.fastly.net IN A + (172.30.1.4) | |
01-May-2014 17:46:23.987 queries: info: client 172.30.1.1#60590: query: ssl.google-analytics.com IN A + (172.30.1.4) | |
01-May-2014 17:46:33.828 queries: info: client 172.30.1.1#56454: query: clients1.google.com IN A + (172.30.1.4) | |
01-May-2014 17:46:38.837 queries: info: client 172.30.1.1#64967: query: accounts.google.com IN A + (172.30.1.4) | |
01-May-2014 17:47:18.630 queries: info: client 172.30.1.1#54250: query: fbcdn-profile-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:47:19.630 queries: info: client 172.30.1.1#54250: query: fbcdn-profile-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:47:43.830 queries: info: client 172.30.1.1#51961: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:48:01.743 queries: info: client 172.30.1.1#55108: query: gist.github.com IN A + (172.30.1.4) | |
01-May-2014 17:48:03.567 queries: info: client 172.30.1.1#62792: query: collector.githubapp.com IN A + (172.30.1.4) | |
01-May-2014 17:48:20.773 queries: info: client 172.30.1.1#60028: query: gist-assets.github.com IN A + (172.30.1.4) | |
01-May-2014 17:48:44.831 queries: info: client 172.30.1.1#59910: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:49:45.830 queries: info: client 172.30.1.1#56756: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:51:15.842 queries: info: client 172.30.1.1#53227: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:51:39.470 queries: info: client 172.30.1.1#61144: query: fbexternal-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:51:46.437 queries: info: client 172.30.1.1#62212: query: fbcdn-profile-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:51:49.280 queries: info: client 172.30.1.1#53261: query: fbcdn-dragon-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:51:49.288 queries: info: client 172.30.1.1#52887: query: fbstatic-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:51:49.293 queries: info: client 172.30.1.1#51540: query: scontent-a.xx.fbcdn.net IN A + (172.30.1.4) | |
01-May-2014 17:51:49.297 queries: info: client 172.30.1.1#55470: query: scontent-b.xx.fbcdn.net IN A + (172.30.1.4) | |
01-May-2014 17:51:50.095 queries: info: client 172.30.1.1#52085: query: gist.github.com IN A + (172.30.1.4) | |
01-May-2014 17:51:51.091 queries: info: client 172.30.1.1#63200: query: gist-assets.github.com IN A + (172.30.1.4) | |
01-May-2014 17:51:51.099 queries: info: client 172.30.1.1#51125: query: avatars0.githubusercontent.com IN A + (172.30.1.4) | |
01-May-2014 17:51:51.797 queries: info: client 172.30.1.1#62332: query: collector.githubapp.com IN A + (172.30.1.4) | |
01-May-2014 17:51:55.837 queries: info: client 172.30.1.1#65496: query: accounts.google.com IN A + (172.30.1.4) | |
01-May-2014 17:52:16.850 queries: info: client 172.30.1.1#58211: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:52:59.993 queries: info: client 172.30.1.1#60978: query: fbcdn-dragon-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:53:00.015 queries: info: client 172.30.1.1#57340: query: fbcdn-profile-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:53:00.021 queries: info: client 172.30.1.1#62978: query: fbstatic-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:53:00.026 queries: info: client 172.30.1.1#65370: query: scontent-a.xx.fbcdn.net IN A + (172.30.1.4) | |
01-May-2014 17:53:00.030 queries: info: client 172.30.1.1#60910: query: scontent-b.xx.fbcdn.net IN A + (172.30.1.4) | |
01-May-2014 17:53:00.076 queries: info: client 172.30.1.1#55269: query: www.facebook.com IN A + (172.30.1.4) | |
01-May-2014 17:53:04.503 queries: info: client 172.30.1.1#57250: query: fbcdn-photos-a-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:53:10.649 queries: info: client 172.30.1.1#53930: query: 1-p-07-ash2.channel.facebook.com IN A + (172.30.1.4) | |
01-May-2014 17:53:13.393 queries: info: client 172.30.1.1#59156: query: p-07-ash2.channel.facebook.com IN A + (172.30.1.4) | |
01-May-2014 17:53:17.839 queries: info: client 172.30.1.1#51934: query: syndication.twitter.com IN A + (172.30.1.4) | |
01-May-2014 17:53:48.044 queries: info: client 172.30.1.1#60740: query: sv0000.yongbok.net IN A + (172.30.1.4) | |
01-May-2014 17:54:13.873 queries: info: client 172.30.1.1#49983: query: www.google.co.kr IN A + (172.30.1.4) | |
01-May-2014 17:54:13.880 queries: info: client 172.30.1.1#61803: query: apis.google.com IN A + (172.30.1.4) | |
01-May-2014 17:54:13.888 queries: info: client 172.30.1.1#58291: query: encrypted-tbn0.gstatic.com IN A + (172.30.1.4) | |
01-May-2014 17:54:13.898 queries: info: client 172.30.1.1#59985: query: ssl.gstatic.com IN A + (172.30.1.4) | |
01-May-2014 17:54:13.961 queries: info: client 172.30.1.1#62188: query: www.gstatic.com IN A + (172.30.1.4) | |
01-May-2014 17:54:17.426 queries: info: client 172.30.1.1#55080: query: fbstatic-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.513 queries: info: client 172.30.1.1#49188: query: fbcdn-profile-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.523 queries: info: client 172.30.1.1#59555: query: fbexternal-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.530 queries: info: client 172.30.1.1#64126: query: scontent-b.xx.fbcdn.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.538 queries: info: client 172.30.1.1#55505: query: fbcdn-sphotos-h-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.542 queries: info: client 172.30.1.1#64342: query: fbcdn-sphotos-d-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.576 queries: info: client 172.30.1.1#57573: query: fbcdn-sphotos-e-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:17.593 queries: info: client 172.30.1.1#53192: query: fbcdn-sphotos-c-a.akamaihd.net IN A + (172.30.1.4) | |
01-May-2014 17:54:18.836 queries: info: client 172.30.1.1#54475: query: syndication.twitter.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