Phiên bản Ubuntu dành cho server
Bên cạnh phiên bản Ubuntu dành cho máy tính cá nhân (Ubuntu Desktop Edition), người dùng cũng có thể sử dụng Ubuntu, phiên bản dành cho máy chủ (Ubuntu Server Edition). 2. Cấu hình hệ thống Các bước thực hiện lần lượt như sau: 1. Cài đặt Ubuntu server, phiên bản 7.10 2. Cấu hình DNS server 2.2. Cấu hình ubuntu-desktop
Ubuntu Server Edition giúp bạn thiết lập các dịch vụ Internet như Mail, Web, DNS, LDAP, FTP… và LAMP (Linux, Apache, MySQL and PHP).
Bài viết chia sẻ đến bạn đọc các bước triển khai dịch vụ DNS trên Ubuntu Server. Qua đó, giúp bạn đọc nắm được tổng quan những bước căn bản để triển khai các dịch vụ tương tự.
1. Yêu cầu hệ thống
Chúng ta sử dụng 04 máy tính với thông tin như sau: 
2.1. Cấu hình ubuntu-server
Trên máy ubuntu-server, bạn thực hiện các phần sau:
ubuntu-desktop01.bits.com.vn 192.168.10.12
ubuntu-desktop02.bits.com.vn 192.168.10.14
ubuntu-desktop03.bits.com.vn 192.168.10.16
Cài đặt và cấu hình DNS server với phần mềm BIND.
Trong quá trình cài đặt, thiết lập các thông số sau:
Phần mềm dùng để xây dựng DNS server trên Ubuntu là BIND (Berkeley Internet Name Domain). Chúng ta sẽ thao tác trên các file của BIND để cấu hình DNS server. Các bước thực hiện như sau:
tthai@ubuntu-server:~$ sudo -i
[sudo] password for tthai:
root@ubuntu-server:~#
root@ubuntu-server:~# mkdir /backup
root@ubuntu-server:~# cp -R /etc/bind /backup
Hiệu chỉnh file cấu hình chính của BIND - /etc/bind/named.conf - bằng cách bổ sung các dòng sau vào cuối file:
root@ubuntu-server:~# vim /etc/bind/named.conf
...
// The zone definition
zone “bits.com.vn” {
type master;
file “/etc/bind/zones/bits.com.vn.db”;
};
// The zone definition for reverse DNS
zone “10.168.192.in-addr.arpa” {
type master;
file “/etc/bind/zones/rev.10.168.192.in-addr.arpa”;
};
Hiệu chỉnh file /etc/bind/named.conf.options để chuyển (forward) những yêu cầu mà DNS server này không phân giải được:
root@ubuntu-server:~# vim /etc/bind/named.conf.options
options {
…
forwarders {
10.238.200.1;
10.238.200.8;
10.238.200.12;
};
};
Tạo các file zone:
root@ubuntu-server:~# mkdir /etc/bind/zones
root@ubuntu-server:~# vim /etc/bind/zones/bits.com.vn.db
$TTL 604800
@ IN SOA ubuntu-server.bits.com.vn. admin.bits.com.vn. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800) ; Negative Cache TTL
;
; Replace the following line as necessary:
; ns1 = DNS server name
; mail = Mail server name
; bits.com.vn. IN MX 10 mail.bits.com.vn.
@ IN NS ubuntu-server.bits.com.vn.
@ IN A 192.168.10.2
ubuntu-server.bits.com.vn. IN A 192.168.10.2
ubuntu-desktop01.bits.com.vn. IN A 192.168.10.12
ubuntu-desktop02.bits.com.vn. IN A 192.168.10.14
ubuntu-desktop03.bits.com.vn. IN A 192.168.10.16
root@ubuntu-server:~# vim /etc/bind/zones/rev.10.168.192.in-addr.arpa
; The number before IN PTR ubuntu-server.bits.com.vn is
; the machine address of the DNS server. In this case, it’s
; 2, as my IP address is 192.168.10.2.
$TTL 604800
@ IN SOA ubuntu-server.bits.com.vn. admin.bits.com.vn. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800) ; Negative Cache TTL
;
@ IN NS ubuntu-server.bits.com.vn.
2 IN PTR ubuntu-server.bits.com.vn.
12 IN PTR ubuntu-desktop01.bits.com.vn.
14 IN PTR ubuntu-desktop02.bits.com.vn.
16 IN PTR ubuntu-desktop03.bits.com.vn.
Hiệu chỉnh file /etc/resolv.conf để liệt kê danh sách các DNS server trong mạng của mình:
root@ubuntu-server:~# vim /etc/resolv.conf
search bits.com.vn
nameserver 192.168.10.2
root@ubuntu-server:~# /etc/init.d/bind9 restart
root@ubuntu-server:~# dig bits.com.vn
Bên cạnh đó, bạn cũng nên sử dụng tiện ích ping để kiểm tra:
root@ubuntu-server:~# ping bits.com.vn
root@ubuntu-server:~# ping ubuntu-server
root@ubuntu-server:~# ping ubuntu-server.bits.com.vn
Nếu kết quả trả về của lệnh ping là các dòng Reply from… thì có nghĩa rằng DNS server của bạn đã hoạt động đúng đắn.
Trên các máy tính ubuntu-desktop, bạn thiết lập các thông số mạng với địa chỉ IP của DNS server là 192.168.61.2 như hình sau: 
Posted








0 comments:
Post a Comment