ติดตั้ง NAMED สำหรับ DNS Server (2026)
OS ใช้ Ubuntu Server 26.04 และ BIND9
การติดตั้ง Domain Name Server
Download and Install https://ubuntu.com/download/server
Set IP Address and Setup University Proxy
Install OpenSSH Server
install bind9 DNS Server
$apt update
$apt upgrade
$apt install bind9 bind9utils bind9-doc dnsutils -y
Enable and Start the DNS Service
$systemctl start bind9
$systemctl enable bind9
$systemctl status bind9
Configure Basic Options และ Configure DNS Zones และ Create Zone Files
$vim /etc/bind/named.conf.options
Test the Configuration and Restart
$named-checkconf
$systemctl restart bind9
Configure the Firewall
$ufw allow bind9
สามารถใช้ Webmin ในการบริหารจัดการ DNS Server ได้ เป็น Web Service (Optional)
$curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh
$bash webmin-setup-repo.sh
$apt install --install-recommends webmin -y
Manage DNS by the Webmin Web Service on Ubuntu
$systemctl enable webmin
$systemctl start webmin
$systemctl status webmin
Configure Firewall Rules สำหรับ Web และ Webmin
$ufw allow 80/tcp
$ufw allow 443/tcp
$ufw allow 10000/tcp
Access to the Web https://webmin.example.com:10000
OS ใช้ CentOS 6.6 (2014)
โดย BIND จะเป็น version 9.8.2 ในตอนติดตั้งนะคับ
ทำการติดตั้ง CentOS 6.6 พร้อมตั้งค่า SSH เพื่อ Admin Remote Connection และ Update Firewall
ทำการ Update OS เพื่อเตรียมพร้อมก่อนการติดตั้ง Software
$ yum update -y
ติดตั้ง Software BIND และ BIND Utility โดยใช้ YUM
$ yum install bind bind-utils -y
ทำการ ตั้งค่า Configuration ของ BIND
$ vim /etc/named.conf
ทั้งนี้การ Configure BIND ของ ICT ต้อง อนุญาตให้ Server DNS ของมหาวิทยาลัย (202.28.162.1 และ 202.28.162.2) เข้ามาอ่าน Configure ได้ด้วย
พร้อมทั้งตั้งค่า Zone ต่างๆตามที่ได้ Configure ไว้ใน /etc/named.conf
รอ BIND สร้าง rndc.key สักครู่ หลังจากนั้น Restart Service
$ service named restart
พอ Restart สำเร็จ ทำการตั้งค่าให้ BIND เริ่มต้นทำงานเมื่อเครื่องเปิด
$ chkconfig named on
ตรวจสอบการทำงานของ BIND ได้ด้วย DIG ตามนี้
$ dig @10.10.10.10 domain.com