ufw防火牆自架dns主機

Post Reply
Brave Ye
系統管理員
Posts: 5658
Joined: 2025-11-08, 13:32
Location: Taiwan
Contact:

ufw防火牆自架dns主機

Post by Brave Ye »

再設定ufw規則

Code: Select all

# 1. Set default policies to deny incoming, allow outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing

# 2. Allow necessary services (HTTP/HTTPS)
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# 3. Allow DNS (UDP & TCP for queries)
sudo ufw allow 53

# 5. Enable UFW
sudo ufw enable

# 6. Verify rules
sudo ufw status verbose
從server world 上設定Debian 13
再裝dns bind9

Code: Select all

 apt -y install bind9 bind9utils
nano /etc/default/named

Code: Select all

#
# run resolvconf?
#RESOLVCONF=no
# startup options for the server
#改下面這一行
OPTIONS="-u bind -4"
nano /etc/resolv.conf
例如我的ip是123.240.180.243

Code: Select all

# Generated by NetworkManager
nameserver 123.240.180.243
#一定要設下面這行
nameserver 8.8.8.8
並開機啟動named服務

Code: Select all

systemctl enable named

Code: Select all

systemctl restart named
接下來用Debian安裝mediawiki來安裝apache2 php mysql(也就是mariadb)
viewtopic.php?p=3808
接下來設定 apache2 的 ssl 傳輸加密
viewtopic.php?t=3902&sid=e051ab242bfc9a ... 0beb282da0
bind.tar.gz
(1.66 KiB) Downloaded 79 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests