我已经在 Ubuntu 22.04 LTS 上设置了一个工作 DNS 服务器,作为单个服务器(DNS、SPF、电子邮件、防火墙等)的一部分。IP:192.168.122.189 测试域:jetj.ltd 主机名:mail
我拥有的文件是:db.jetj.ltd:
;
; BIND data file for jetj.ltd
;
$INCLUDE /etc/bind/keys/Kjetj.ltd.+008+12125.key
$TTL 86400
@ IN SOA mail.jetj.ltd. karti.jetj.ltd. (
2023082501 ; Serial
3600 ; Refresh
1800 ; Retry
604800 ; Expire
86400 ; Minimum TTL
)
; Name Server (NS) records
@ IN NS mail.jetj.ltd.
@ IN A 192.168.122.189
; A record for the domain's nameserver
mail IN A 192.168.122.189
; Mail Exchanger (MX) record
@ IN MX 10 mail.jetj.ltd.
命名的.conf.选项:
options {
directory "/var/cache/bind";
recursion yes;
listen-on { 192.168.122.189; };
allow-query { localhost; 192.168.122.0/24; }; // Allow queries from localhost and your local network
forwarders {
8.8.8.8;
8.8.4.4;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
listen-on-v6 { any; };
};
trust-anchors {
"." initial-key 256 3 8 "AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQbSEW0O8gcCjF
FVQUTf6v58fLjwBd0YI0EzrAcQqBGCzh/RStIoO8g0NfnfL2MTJRkxoX
bfDaUeVPQuYEhg37NZWAJQ9VnMVDxP/VHL496M/QZxkjf5/Efucp2gaD
X6RS6CXpoY68LsvPVjR0ZSwzz1apAzvN9dlzEheX7ICJBBtuA6G3LQpz
W5hOA2hzCTMjJPJ8LbqF6dsV6DoBQzgul0sGIcGOYl7OyQdXfZ57relS
Qageu+ipAdTTJ25AsRTAoub8ONGcLmqrAmRLKBP1dfwhYB4N7knNnulq
QxA+Uk1ihz0=";
};
命名.conf.本地:
zone "jetj.ltd" {
type master;
file "/etc/bind/db.jetj.ltd";
dnssec-policy default;
inline-signing yes;
};
zone "122.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192";
dnssec-policy default;
inline-signing yes;
};
当我运行 named-checkconf 时 - 没有任何错误。我通过运行以下命令获取密钥:
sudo dnssec-keygen -a RSASHA256 -b 2048 -f KSK -L 9000000 jetj.ltd
我将这些添加到db.jetj.ltd文件中。
但是,当我尝试 dnssec-signzone 时,我收到以下错误:
karti@mail:/etc/bind$ dnssec-signzone -S -K keys/ db.jetj.ltd
dnssec-signzone: fatal: No signing keys specified or found.
我检查并更改了密钥,如下所示:
karti@mail:/etc/bind/keys$ cat Kjetj.ltd.+008+12125.key
; This is a key-signing key, keyid 12125, for jetj.ltd.
; Created: 20230905194204 (Tue Sep 5 19:42:04 2023)
; Publish: 20230905194204 (Tue Sep 5 19:42:04 2023)
; Activate: 20230905194204 (Tue Sep 5 19:42:04 2023)
jetj.ltd. 9000000 IN DNSKEY 257 3 8 AwEAAbSbc3FDpa6u5FWnxza3wBzY+j6/zj6fs/5UWzzC5EmVugKloM9H 2j+2y6K8ShWDj744COlOFA+JfbFHzhFWDeg/MpXyKX8ah5K2rB3apdQc 48BytgoXgflyBHO9/tHJOlkNDNiL7Nk3VBLABl2MZr2+XM5bQV9Bx8bA tBI+8+yPHMcq9hJ8ZZW8Fc2NENWw1cS+4hJpiNEM3vBVanRBKAfczZR5 Odx4qGoDBatDR00dfNzlrpr3cvy66giNEbDv2APPMO8YD6rTeT0GyMXM gQ1SULHxAo3G8GmzEiAd6rplKA4tZ+TXIPHZqx8/5Nu6moizXntxGOCU 4egalBQoQKs=
感谢大家的帮助和评论。我已经研究了大约一周,但毫无收获。
提前致谢。
钾