You are on page 1of 3

1.

Cài đặt chương trình BIND

- Cấu hình IP Static, máy tính có thể kết nối Internet

- Install BIND DNS

[root@srv-1 ~]# yum install bind bind-untils

2. Cấu hình các thông số cho BIND DNS

- Xác định vị trí các file liên quan đến chương trình Bind DNS

[root@srv-1 ~]# updatedb


[root@srv-1 ~]# locate named

- Cấu hình cho DNS Server không sử dụng IPv6

[root@srv-1 ~]# vi /etc/sysconfig/named


#Them vao dong ben duoi
OPTIONS="-4"

- DNS Server có interface ens33 được gán IP 192.168.255.18/24, thuộc đường mạng
192.168.255.0/24
- File cấu hình "/etc/named.conf" để các thông số global cho DNS Server, thông tin
các zone có trong máy chủ

[root@srv-1 ~]# vi /etc/named.conf

+ Di den dong so 11, them vao dau #. Nghia rang DNS srv-1 se "Listen tren tat ca
cac interface IPv4"

#listen-on port 53 { 127.0.0.1; };

+ Di den dong 12, thay doi "::1;" thanh "none;"

listen-on-v6 port 53 { none; };

+ Di den dong 17, cau hinh "allow-query", them vao duong mang 192.168.255.0/24

allow-query { localhost; 192.168.255.0/24;};

+ Them vao sau dong 17, "allow-query-cache"

allow-query-cache { localhost; 192.168.255.0/24; };

+ Them vao "allow-transfer", thiet lap nay duoc su dung khi ta co cau hinh DNS
srv-1 Secondary

allow-transfer { localhost; 192.168.255.0/24; };

+ Cấu hình DNS Forward ra External srv-1 "8.8.8.8" va "8.8.4.4" và chỉ cho phép IP
172.16.100.175 la IP cua DNS srv-1 và các IP thuộc đường mạng 192.168.255.0/24

#recursion yes;
allow-recursion { localhost; 192.168.255.0/24;};
forward only;
forwarders { 8.8.8.8; 8.8.4.4; };

+ Định nghĩa Forward zone va Reverse zone ứng với domain "vmware.lab"

#Tao Forward zone "nltt.local"

zone "athena.nltt.local" IN {
type master;
file "nltt.local.lan";
allow-update { none; };
};

#Tao Reverse zone "100.16.172.in-addr.arpa" ung voi Forward Zone o tren

zone "100.16.172.in-addr.arpa" IN {
type master;
file "100.16.172.db";
allow-update { none; };
};

3. Thiết lập các file thông tin cho domain "nltt.local"

- Ta sẽ tạo ra 2 file "nltt.local.lan" va "100.16.172.db" ứng với quá trình phân


giải thuận và phân giải nghịch.

- Tạo file "nltt.local.lan" ứng với forward zone

[root@srv-1 /]# cd /var/named


touch nltt.local.lan
touch 100.16.172.db
vi nltt.local.lan

$TTL 86400
@ IN SOA dns.athena.NLTT.local. root.athena.NLTT.local. (
0 ;Serial
1D ;Refresh
1H ;Retry
1W ;Expire
3H ;Minimum TTL
)

IN NS dns.athena.NLTT.local.
IN A 192.168.255.18

dns IN A 192.168.255.18
ftp IN A 192.168.255.18

- Tao file "255.168.192.db" la reverse zone

[root@srv-1 named]# vi 255.168.192.db

$TTL 86400
@ IN SOA dns.athen.nltt.local. root.athena.nltt.local. (
0 ;Serial
1D ;Refresh
1H ;Retry
1W ;Expire
3H ;Minimum TTL
)

NS dns.athena.nltt.local.
18 IN PTR dns.athena.nltt.local.
18 IN PTR ftp.athena.nltt.local.

4. Khởi động dịch vụ named và thử phân giải tên miền

- Khởi động dịch vụ named

[root@srv-1 ~]# systemctl restart named

nslookup

server 192.168.255.18

NLLT.local

You might also like