Let’s Encryptでドメインにワイルドカードを使用するには、次のコマンドを実行します。
※例として*.example.comを設定しています。以下、example.comのところを、お使いのドメインに置き換えていただければと思います。
$ certbot certonly --manual --preferred-challenges dns-01 -d *.example.com -m info@example.com
コマンドを実行すると、次のようなメッセージが出力されます。xxxx…のところには、実際には英数字およびアンダースコア等で構成された文字列が表示されます。
Performing the following challenges:
dns-01 challenge for example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.example.com with the following value:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
xxxx…の文字列を、DNSのTXTレコード(キーは_acme-challenge.example.com)として設定します。設定前に、勢い余ってEnterを押さないことに注意します。
TXTレコードの設定が反映されたら、Enterを押して完了です。
TXTレコードを確認するには次のコマンドが便利です。
$ host -t txt _acme-challenge.example.com