Add full project files
This commit is contained in:
40
scripts/dns/db.modstagram.com
Normal file
40
scripts/dns/db.modstagram.com
Normal file
@@ -0,0 +1,40 @@
|
||||
$TTL 3600
|
||||
@ IN SOA ns1.modstagram.com. admin.modstagram.com. (
|
||||
2026061702 ; Serial — با هر تغییر +1 کنید
|
||||
3600
|
||||
1800
|
||||
604800
|
||||
86400 )
|
||||
|
||||
; ═══════════════════════════════════════
|
||||
; Nameservers — سرور شما
|
||||
; ═══════════════════════════════════════
|
||||
@ IN NS ns1.modstagram.com.
|
||||
@ IN NS ns2.modstagram.com.
|
||||
|
||||
ns1 IN A 185.164.73.197
|
||||
ns2 IN A 185.164.73.197
|
||||
|
||||
; ═══════════════════════════════════════
|
||||
; سابدامینها — همه به IP سرور
|
||||
; ═══════════════════════════════════════
|
||||
@ IN A 185.164.73.197
|
||||
www IN A 185.164.73.197
|
||||
api IN A 185.164.73.197
|
||||
app IN A 185.164.73.197
|
||||
panel IN A 185.164.73.197
|
||||
blog IN A 185.164.73.197
|
||||
pay IN A 185.164.73.197
|
||||
cdn IN A 185.164.73.197
|
||||
|
||||
; ═══════════════════════════════════════
|
||||
; SPF — ایمیل (همان مقادیر فعلی شما)
|
||||
; ═══════════════════════════════════════
|
||||
@ IN TXT "v=spf1 a mx ip4:185.164.73.197 ~all"
|
||||
* IN TXT "v=spf1 a mx ip4:185.164.73.197 ~all"
|
||||
|
||||
; ═══════════════════════════════════════
|
||||
; ایمیل (اختیاری)
|
||||
; ═══════════════════════════════════════
|
||||
@ IN MX 10 mail.modstagram.com.
|
||||
mail IN A 185.164.73.197
|
||||
21
scripts/dns/db.modstagram.ir
Normal file
21
scripts/dns/db.modstagram.ir
Normal file
@@ -0,0 +1,21 @@
|
||||
$TTL 3600
|
||||
@ IN SOA ns1.modstagram.com. admin.modstagram.com. (
|
||||
2026061702
|
||||
3600
|
||||
1800
|
||||
604800
|
||||
86400 )
|
||||
|
||||
@ IN NS ns1.modstagram.com.
|
||||
@ IN NS ns2.modstagram.com.
|
||||
|
||||
@ IN A 185.164.73.197
|
||||
www IN A 185.164.73.197
|
||||
api IN A 185.164.73.197
|
||||
app IN A 185.164.73.197
|
||||
panel IN A 185.164.73.197
|
||||
blog IN A 185.164.73.197
|
||||
pay IN A 185.164.73.197
|
||||
cdn IN A 185.164.73.197
|
||||
|
||||
@ IN TXT "v=spf1 a mx ip4:185.164.73.197 ~all"
|
||||
45
scripts/dns/install-bind9.sh
Normal file
45
scripts/dns/install-bind9.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# نصب BIND9 و فعالسازی zone modstagram.com روی سرور Asiatech
|
||||
# اجرا: bash install-bind9.sh
|
||||
|
||||
set -e
|
||||
|
||||
ZONE_FILE="/etc/bind/db.modstagram.com"
|
||||
SOURCE="$(dirname "$0")/modstagram.com.zone"
|
||||
|
||||
apt-get update
|
||||
apt-get install -y bind9 bind9utils
|
||||
|
||||
cp "$SOURCE" "$ZONE_FILE"
|
||||
chown root:bind "$ZONE_FILE"
|
||||
chmod 644 "$ZONE_FILE"
|
||||
|
||||
if ! grep -q 'zone "modstagram.com"' /etc/bind/named.conf.local 2>/dev/null; then
|
||||
cat >> /etc/bind/named.conf.local << 'EOF'
|
||||
|
||||
zone "modstagram.com" {
|
||||
type master;
|
||||
file "/etc/bind/db.modstagram.com";
|
||||
};
|
||||
EOF
|
||||
fi
|
||||
|
||||
# اجازه query از بیرون
|
||||
OPTIONS_FILE="/etc/bind/named.conf.options"
|
||||
if grep -q 'allow-query' "$OPTIONS_FILE"; then
|
||||
sed -i 's/allow-query { any; };/allow-query { any; };/' "$OPTIONS_FILE" || true
|
||||
else
|
||||
sed -i '/recursion yes;/a \ allow-query { any; };' "$OPTIONS_FILE" || true
|
||||
fi
|
||||
|
||||
named-checkconf
|
||||
named-checkzone modstagram.com "$ZONE_FILE"
|
||||
|
||||
systemctl enable bind9
|
||||
systemctl restart bind9
|
||||
|
||||
echo ""
|
||||
echo "BIND9 OK. تست محلی:"
|
||||
dig @127.0.0.1 api.modstagram.com +short
|
||||
echo ""
|
||||
echo "قدم بعد: در پنل رجیسترار NS را به ns1.modstagram.com و ns2.modstagram.com تغییر دهید + Glue records"
|
||||
38
scripts/dns/modstagram.com.zone
Normal file
38
scripts/dns/modstagram.com.zone
Normal file
@@ -0,0 +1,38 @@
|
||||
$TTL 3600
|
||||
@ IN SOA ns1.modstagram.com. admin.modstagram.com. (
|
||||
2026061901 ; Serial (YYYYMMDDnn — بعد از هر تغییر +1)
|
||||
3600 ; Refresh
|
||||
1800 ; Retry
|
||||
604800 ; Expire
|
||||
3600 ) ; Minimum TTL
|
||||
|
||||
; Nameservers (هر دو روی همین سرور — برای setup تکسروره OK است)
|
||||
@ IN NS ns1.modstagram.com.
|
||||
@ IN NS ns2.modstagram.com.
|
||||
|
||||
; Glue records (در رجیسترار هم باید ثبت شوند)
|
||||
ns1 IN A 193.151.143.243
|
||||
ns2 IN A 193.151.143.243
|
||||
|
||||
; --- سایت و سابدامنههای اصلی ---
|
||||
@ IN A 193.151.143.243
|
||||
www IN A 193.151.143.243
|
||||
|
||||
api IN A 193.151.143.243
|
||||
app IN A 193.151.143.243
|
||||
panel IN A 193.151.143.243
|
||||
pay IN A 193.151.143.243
|
||||
|
||||
; اختیاری — اگر nginx برای اینها فعال است
|
||||
cdn IN A 193.151.143.243
|
||||
blog IN A 193.151.143.243
|
||||
|
||||
; Wildcard (اختیاری — همه سابدامنههای تعریفنشده)
|
||||
; * IN A 193.151.143.243
|
||||
|
||||
; --- ایمیل (فقط اگر mail روی همین سرور است؛ وگرنه مقادیر قدیم را نگه دار) ---
|
||||
; @ IN MX 10 mail.modstagram.com.
|
||||
; mail IN A YOUR_MAIL_SERVER_IP
|
||||
|
||||
; --- SSL Let's Encrypt (HTTP-01 معمولاً کافی است؛ برای DNS-01) ---
|
||||
; _acme-challenge IN TXT "..."
|
||||
11
scripts/dns/named.conf.local.snippet
Normal file
11
scripts/dns/named.conf.local.snippet
Normal file
@@ -0,0 +1,11 @@
|
||||
// این بلوکها را به /etc/bind/named.conf.local اضافه کنید
|
||||
|
||||
zone "modstagram.com" {
|
||||
type master;
|
||||
file "/etc/bind/db.modstagram.com";
|
||||
};
|
||||
|
||||
zone "modstagram.ir" {
|
||||
type master;
|
||||
file "/etc/bind/db.modstagram.ir";
|
||||
};
|
||||
Reference in New Issue
Block a user