DNS là dịch vụ phân giải tên miền quá quen thuộc. AdminVietnam sẽ hướng dẫn các bạn cấu hình dịch vụ DNS trên Centos Server.

Đang tải

Các bạn có thểm tham khảo DNS là gì từ địa chỉ này

Đầu tiên ta cần đặt tên máy DNS Server là server.adminvietnam.org IP là 192.168.61.10 trong file /etc/sysconfig/network

#vi /etc/sysconfig/network

Tắt Selinux

# vi /etc/selinux/config

Setup bind

# yum install bind* -y

Cấu hình DNS Server chính

# vi /etc/named.conf

chúng ta sửa những chỗ chữ đỏ

options
{
query-source port 53;
query-source-v6 port 53;
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";
notify yes;
};
zone "." in {
type hint;
file "named.root";
};

zone "adminvietnam.org" in {
type master;
file "adminvietnam.db";
};

zone "61.168.192.in-addr.arpa" in {
type master;
file "61.168.192.db";
};

Tiếp theo ta tạo file adminvietnam.db61.168.192.db

# vi /var/named/adminvietnam.db

với nội dung file như sau

$TTL 86400
@      IN     SOA    server.adminvietnam.org. root (
                     3;
                     28800;
                     7200;
                     604800;
                     86400;
)
               NS server.adminvietnam.org.
               MX 10 server
               A 192.168.61.10
server         A 192.168.61.10
www            CNAME server
ftp            CNAME server
mail           CNAME server
# vi /var/named/61.168.192.db
$TTL 86400
@     IN   SOA  server.adminvietname.org. root.(
                3;
                28800;
                7200;
                604800;
                86400;
)
@           NS  server.adminvietnam.org
1           PTR server.adminvietnam.org
2           PTR mail.adminvietnam.org
3           PTR ftp.adminvietnam.org
4           PTR www.adminvietnam.org
# vi /var/named/named.root
;           This file holds the information on root name servers needed to
;           initialize cache of Internet domain name servers
;           (e.g. reference this file in the "cache . <file>"
;           configuration file of BIND domain name servers).
;
;           This file is made available by InterNIC 
;           under anonymous FTP as
;               file /domain/named.cache
;               on server FTP.INTERNIC.NET
;           -OR- RS.INTERNIC.NET
;
;           last update: Jun 8, 2011
;           related version of root zone: 2011060800
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN    NS     A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000        A      198.41.0.4
A.ROOT-SERVERS.NET.      3600000        AAAA   2001:503:BA3E::2:30
;
; FORMERLY NS1.ISI.EDU
;
.                        3600000        NS   B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000        A    192.228.79.201
;
; FORMERLY C.PSI.NET
;
.                        3600000        NS   C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000        A    192.33.4.12
;
; FORMERLY TERP.UMD.EDU
;
.                        3600000        NS   D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000        A    128.8.10.90
D.ROOT-SERVERS.NET.      3600000        AAAA 2001:500:2D::D
;
; FORMERLY NS.NASA.GOV
;
.                        3600000        NS   E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000        A    192.203.230.10
;
; FORMERLY NS.ISC.ORG
;
.                        3600000        NS   F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000        A    192.5.5.241
F.ROOT-SERVERS.NET.      3600000        AAAA 2001:500:2F::F
;
; FORMERLY NS.NIC.DDN.MIL
;
.                        3600000        NS   G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000        A    192.112.36.4
;
; FORMERLY AOS.ARL.ARMY.MIL
;
.                        3600000        NS   H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000        A    128.63.2.53
H.ROOT-SERVERS.NET.      3600000        AAAA 2001:500:1::803F:235
;
; FORMERLY NIC.NORDU.NET
;
.                        3600000        NS   I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000        A    192.36.148.17
I.ROOT-SERVERS.NET.      3600000        AAAA 2001:7FE::53
;
; OPERATED BY VERISIGN, INC.
;
.                        3600000        NS   J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000        A    192.58.128.30
J.ROOT-SERVERS.NET.      3600000        AAAA 2001:503:C27::2:30
;
; OPERATED BY RIPE NCC
;
.                        3600000        NS   K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000        A    193.0.14.129
K.ROOT-SERVERS.NET.      3600000        AAAA 2001:7FD::1
;
; OPERATED BY ICANN
;
.                        3600000        NS   L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000        A    199.7.83.42
L.ROOT-SERVERS.NET.      3600000        AAAA 2001:500:3::42
;
; OPERATED BY WIDE
;
.                        3600000        NS   M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000        A    202.12.27.33
M.ROOT-SERVERS.NET.      3600000        AAAA 2001:DC3::35
; End of File

Sau khi hoàn tất ta khởi động dịch vụ named

# service named start
# chkconfig named on

Nguyễn Hoàng Anh – AdminVietnam.org