主持人:數位海洋
作業系統:中央作業系統
我有一個涵蓋我的網域的現有 SSL 憑證。
$ certbot certificates
產生這個輸出。
Found the following certs:
Certificate Name: example.com
Domains: example.com www.example.com
Expiry Date: 2020-04-12 21:20:31+00:00 (VALID: 86 days)
Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem
我安裝了postfix
,我相信我需要添加mail.example.com到我的證書。
我嘗試添加mail.example.com使用此命令到我的證書,
$ sudo certbot certonly --standalone -d mail.example.com
不幸的是它拋出了這個錯誤,
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mail.example.com
Waiting for verification…
Challenge failed for domain mail.example.com
http-01 challenge for mail.example.com
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
The following errors were reported by the server:
Domain: mail.example.com
Type: dns
Detail: DNS problem: NXDOMAIN looking up A for mail.example.com
看來 certbot 正在嘗試安裝mail.example.com使用 A 記錄。關於我的網域記錄部分中的數位海洋mail.example.com建立為 MX 記錄,而不是 A 記錄。
答案1
您是對的,為了郵件投遞,您需要 MX-條目。但是:mail.testsite.com 是完全限定的主機名稱。並且您需要告訴每個想要向您發送郵件的人該主機名稱的 IP 位址是什麼。因此,您還需要一筆 A 記錄,指向您要接收郵件的伺服器。
建立一筆記錄並指向您的郵件伺服器並從該電腦執行 certbot。確保網頁伺服器在連接埠 80 上回應 mail.testsite.com,以便驗證成功。然後它就會起作用。
答案2
像這樣做:
$ sudo certbot -d mail.example.com --manual --preferred-challenges dns certonly
將列印一條 DNS TXT 記錄(只需不要按一下進入也),將其發佈到您的 DNS 並等待,直到您確定可以從 DNS 外部讀取 TXT 記錄,然後按一下進入並將得到驗證。
答案3
如果 Ionos 是您的 DNS 供應商,並且您遵循呼叫郵件伺服器 mail.example.com 的通用約定,則僅建立 A 記錄「mail」和 MX 記錄「mail」是不夠的。您的 TXT 記錄不能滿足 certbot 的要求。
您必須創建一個子域使用 Ionos UI 稱為「郵件」。然後,您可以導覽至 UI 中的該子網域,建立 TXT 記錄並將其命名為「_acme-challenge」。這會產生一個有效的「_acme-challenge.mail.example.com」TXT 記錄。
最好留待將來查詢
在我看來,每次執行 certbot 時,挑戰中的值都會改變。因此,您可以保留 TXT 記錄,但每次都必須對其進行編輯。