---
title: "DKIMレコードの生成方法（ステップバイステップ） | AutoSPF"
description: "DKIM鍵を手作業で書き起こすことはありません。DKIMを有効化すると、メールプロバイダーが公開鍵/秘密鍵のペアを生成します。渡された公開鍵を公開します。"
image: "https://autospf.com/images/og-default.png"
canonical: "https://autospf.com/ja/dkim/how-to-generate-a-dkim-record/"
---

# DKIMレコードの生成方法

DKIM鍵を手作業で書き起こすことはありません。DKIMを有効化すると、メールプロバイダーが公開鍵/秘密鍵のペアを生成します。プロバイダーから渡された公開鍵を、プロバイダーが選んだセレクターにTXTレコードとして公開し、それが解決することを検証します。

このガイドは、[DKIM](/ja/dkim/)に関する完全ガイドの一部です。関連: [DKIMレコード](/ja/dkim/dkim-record/)、[DKIMセレクター](/ja/dkim/dkim-selector/)。

**DKIM鍵を手作業で書き起こすことはありません。メールプロバイダーがあなたのために公開鍵/秘密鍵のペアを生成します。次に、あなたは公開鍵を、プロバイダーが選ぶセレクターホストにTXTレコードとしてDNSに公開し、プロバイダーは秘密鍵を保持して送信メールを署名します。** この単一の「公開して検証する」ループこそが、「DKIMレコードを生成する」ということの実際の意味のすべてです。

## なぜDKIMを手作業ではなくプロバイダーで生成するのか

DKIMは、対になった暗号鍵で機能します。**秘密鍵**は送信プラットフォームの内部にとどまり、すべての送信メッセージを署名します。**公開鍵**はDNSに入り、受信サーバーがその署名を検証できるようにします。秘密鍵は、実際にメールを送信するシステムの内部に安全に存在しなければならないため、プロバイダーだけがペアを正しく生成できる場所です。プロバイダーは両方の鍵を作成し、秘密鍵の半分を署名エンジンが到達できる場所に保管し、公開する公開鍵の半分をあなたに渡します。

これが、自分でやる本当の「DKIMジェネレーター」のステップがない理由です。コンソールでDKIMを有効化することが生成を行い、あなたはその結果を公開するだけです。自前のメールサーバーを運用する上級者は、`openssl`（例えば`openssl genrsa`と対応する公開鍵のエクスポート）で鍵ペアを手動で生成できますが、自分のMTAを運用しているのでない限り、プロバイダー経由の方法を守ってください。その方が速く、エラーが起きにくく、秘密鍵をあるべき場所に保ちます。

## ステップバイステップ: DKIMの生成と公開

1. **プロバイダーのコンソールでDKIM（メール認証）を有効化する。** 送信ドメインの「DKIM」「メール認証」または「ドメイン認証」の設定を探します。それをオンにすると鍵の生成がトリガーされます。
2. **出力を読む: 公開鍵と[セレクター](/ja/dkim/dkim-selector/)ホスト。** プロバイダーは公開鍵と、それを公開すべき正確なホスト名（`s1._domainkey.yourdomain.com`のようなセレクター）を渡します。
3. **TXTレコードをDNSに公開する。** そのセレクターホストに、プロバイダーが提供した値でTXT（場合によってはCNAME）レコードを追加します。正確な形式、タグ、値の構造については[DKIMレコード](/ja/dkim/dkim-record/)を参照してください。
4. **無料の[DKIMルックアップツール](/ja/tools/dkim-lookup/)で検証する。** ドメインとセレクターを入力し、公開鍵がDNSで有効かつ読み取り可能であることを確認します。DNSの変更が伝播するには少し時間がかかることがあるため、すぐに見つからない場合は再確認してください。
5. **メールが署名されていることを確認する。** テストメッセージを送信し、ヘッダー（またはプロバイダーのダッシュボード）に`DKIM-Signature`ヘッダーと`dkim=pass`の結果があるか調べます。これで秘密鍵が署名しており、公開鍵が検証していることが確認できます。

## 一般的なプロバイダーでDKIMを生成する場所

| プロバイダー                    | DKIMを生成する場所                                                   |
| ------------------------- | ------------------------------------------------------------- |
| Google Workspace          | 管理コンソール > アプリ > Google Workspace > Gmail > メールを認証する           |
| Microsoft 365             | Microsoft Defenderポータル > メールとコラボレーション > ポリシー > メール認証設定 > DKIM |
| ESP（SendGrid、Mailchimpなど） | 「ドメイン認証」の際に自動提供される — プラットフォームが鍵を生成し、公開するレコードを渡す               |

Google WorkspaceとMicrosoft 365では、鍵を生成してから、表示されるレコードを公開します。ほとんどのESPでは、ドメイン認証がDKIM（多くの場合SPFやトラッキングドメインと一緒に）をまとめて処理するため、リストされたレコードを追加するだけです。

## 鍵の長さ: 1024 vs 2048

プロバイダーが選択肢を提供する場合は、**2048ビット**の鍵を選んでください。これらは1024ビットよりも意味のある形で強力であり、現在では業界全体で推奨されるデフォルトです。唯一の注意点は、2048ビットの公開鍵が1024ビットのものよりも長いことで、一部の古いDNSインターフェースは255文字を超えるTXTレコードに苦労します。値を複数の引用符付き文字列に分割する必要があるかもしれません。ほとんどの最新のDNSホストはこれを自動的に処理します。プロバイダーが1024ビットしか提供しない場合でも動作しますが、可能なときに2048ビットに移行してください。

## 健全に保つ

DKIMは設定して終わりではありません。鍵は定期的にローテーションしてください。多くのプロバイダーは現在では自動的にローテーションするので、単一の漏洩した鍵が無期限に悪用されることを防げます。そして、DKIMは3部構成のスタックの1本の脚であることを忘れないでください。有効な[SPFレコード](/ja/tools/spf-checker/)、DKIM、DMARCが連携して、あなたのメールが正当であることを証明します。どれか1本の脚が壊れると、配信性が損なわれます。

SPF側では、レコードが参照するサービスが多すぎると、SPFが静かに失敗する原因となる10回のルックアップ制限に注意してください。[AutoSPF](/)はあなたのSPFレコードを自動的にフラット化して維持し、その制限内に収めるため、SPFが下で静かに壊れることなく、DKIMとDMARCを署名とポリシーの側に集中させることができます。

## よくある質問

### DKIMレコードはどうやって生成しますか？

DKIMレコードは、メールプロバイダーのコンソール内でDKIMまたはメール認証を有効化することで生成します。プロバイダーが鍵ペアを作成し、公開鍵とセレクターホストを渡します。次に、その公開鍵をDNSにTXTレコードとして公開して検証すれば、設定が完了します。

### DKIMジェネレーターツールは必要ですか？

通常は不要です。DKIMを有効化するとメールプロバイダーが鍵ペアを生成するため、単体のジェネレーターは冗長であり、秘密鍵を露出させる場合はリスクにさえなり得ます。手動での生成が必要なのは自前ホストのメールサーバーだけで、通常はopensslを使います。それ以外の人にとっては、プロバイダーのコンソールが正しく最も安全な方法です。

### DKIMにはどの鍵の長さを使うべきですか？

プロバイダーが選択肢を提供する場合は常に2048ビットの鍵を使ってください。これらは1024ビットよりも強力で、現在の業界推奨です。唯一の欠点は、一部のレガシーなDNSインターフェースが複数の文字列に分割する必要があるかもしれない、より長いDNS値です。ほとんどの最新のDNSホストは、余分な手順なしに2048ビットのレコードを処理します。

### 生成した後、DKIMレコードはどこに置きますか？

プロバイダーが指定する正確なセレクターホスト（例: `selector._domainkey.yourdomain.com`）に、ドメインのDNSにTXTレコードとして公開します。レコードの値は、プロバイダーが提供した公開鍵です。追加した後は、それに頼る前にDKIMルックアップツールで検証し、有効かつ読み取り可能であることを確認してください。

Rated 5/5 on G2 · Trusted since 2018 

##  Trusted by 50,000+ domains 

### "AutoSPF Flattens SPF Records Seamlessly & Keeps Changes Logged - I am quite pleased with the product"

> It does what it promises to do, and does it very well. I appreciate that it keeps a log of changes made, which prevents many mistakes. A client's SPF record would have way too many lookups, but AutoSPF makes that problem go away. The length of the SPF record is typically not the issue; it's the amount of lookups in the record that are. AutoSPF "flattens" the record, automatically expanding the defined lookups to IP addresses or ranges. And it auto-updates the record when the un-flattened lookups change. 

 PJ 

Peter J.

 President · Small-Business (50 or fewer emp.) 

### "Helped us go beyond capacity"

> AutoSPF did exactly as described, it helped us get past our 10 lookup limit. Afterwards, we hit another limit regarding overall capacity and when contacted, they quickly provided us with a new solution to eliminate capacity issues entirely going forward, so now we can add as many SPF records as needed. They also provided us with a personalized support video explaining their new method in its entirety using our instance as the example. 

 VU 

Verified User

 Financial Services · Mid-Market (51-1000 emp.) 

### "Great service and great support"

> AutoSPF was easy to initially set up on our own and a great cost effective entry into spf flattening. Needed our first support assistance today and got great response including a video demonstrating the issue I was trying to solve, a quick fix, and more detailed followup. 

 GF 

Greg F.

 Mid-Market (51-1000 emp.) 

[Read our reviews on G2 ](https://www.g2.com/products/autospf/reviews)

```json
{"@context":"https://schema.org","@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]},"sameAs":["https://www.wikidata.org/wiki/Q138897474","https://www.linkedin.com/company/autospf","https://x.com/autospf01","https://www.facebook.com/autospf","https://github.com/duocircle","https://www.g2.com/products/autospf/reviews"],"aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"21","bestRating":"5","worstRating":"1","url":"https://www.g2.com/products/autospf/reviews"},"contactPoint":{"@type":"ContactPoint","contactType":"customer support","url":"https://autospf.com/contact-us/"},"knowsAbout":["SPF Record Flattening","Sender Policy Framework","Email Authentication","DNS Management","DMARC","DKIM","Email Deliverability","SPF Lookup Limits"]}
```

```json
{"@context":"https://schema.org","@type":"WebSite","name":"AutoSPF","url":"https://autospf.com","description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","publisher":{"@type":"Organization","name":"AutoSPF","url":"https://autospf.com","logo":{"@type":"ImageObject","url":"https://autospf.com/images/autospf-logo.png"},"description":"Automatic SPF flattening and email authentication management. Resolve SPF lookup limits, flatten SPF records, and maintain email deliverability across all your domains.","parentOrganization":{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138883901","name":"DuoCircle LLC","url":"https://www.duocircle.com","sameAs":["https://www.wikidata.org/wiki/Q138883901","https://www.crunchbase.com/organization/duocircle-llc","https://www.linkedin.com/company/duocircle","https://github.com/duocircle"],"subOrganization":[{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138898167","name":"DMARC Report","url":"https://dmarcreport.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897474","name":"AutoSPF","url":"https://autospf.com"},{"@type":"Organization","@id":"https://www.wikidata.org/wiki/Q138897912","name":"Phish Protection","url":"https://www.phishprotection.com"}]}}}
```

```json
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"DKIMレコードはどうやって生成しますか？","acceptedAnswer":{"@type":"Answer","text":"DKIMレコードは、メールプロバイダーのコンソール内でDKIMまたはメール認証を有効化することで生成します。プロバイダーが鍵ペアを作成し、公開鍵とセレクターホストを渡します。次に、その公開鍵をDNSにTXTレコードとして公開して検証すれば、設定が完了します。"}},{"@type":"Question","name":"DKIMジェネレーターツールは必要ですか？","acceptedAnswer":{"@type":"Answer","text":"通常は不要です。DKIMを有効化するとメールプロバイダーが鍵ペアを生成するため、単体のジェネレーターは冗長であり、秘密鍵を露出させる場合はリスクにさえなり得ます。手動での生成が必要なのは自前ホストのメールサーバーだけで、通常はopensslを使います。それ以外の人にとっては、プロバイダーのコンソールが正しく最も安全な方法です。"}},{"@type":"Question","name":"DKIMにはどの鍵の長さを使うべきですか？","acceptedAnswer":{"@type":"Answer","text":"プロバイダーが選択肢を提供する場合は常に2048ビットの鍵を使ってください。これらは1024ビットよりも強力で、現在の業界推奨です。唯一の欠点は、一部のレガシーなDNSインターフェースが複数の文字列に分割する必要があるかもしれない、より長いDNS値です。ほとんどの最新のDNSホストは、余分な手順なしに2048ビットのレコードを処理します。"}},{"@type":"Question","name":"生成した後、DKIMレコードはどこに置きますか？","acceptedAnswer":{"@type":"Answer","text":"プロバイダーが指定する正確なセレクターホスト（例: `selector._domainkey.yourdomain.com`）に、ドメインのDNSにTXTレコードとして公開します。レコードの値は、プロバイダーが提供した公開鍵です。追加した後は、それに頼る前にDKIMルックアップツールで検証し、有効かつ読み取り可能であることを確認してください。"}}]}
```

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://autospf.com/"},{"@type":"ListItem","position":2,"name":"DKIM","item":"https://autospf.com/ja/dkim/"},{"@type":"ListItem","position":3,"name":"DKIM","item":"https://autospf.com/ja/dkim/how-to-generate-a-dkim-record/"}]}
```

```json
{"@context":"https://schema.org","@type":"Product","name":"AutoSPF","url":"https://autospf.com","aggregateRating":{"@type":"AggregateRating","ratingValue":5,"reviewCount":21,"bestRating":5,"worstRating":1},"review":[{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Peter J.","jobTitle":"President"},"datePublished":"2026-03-10","reviewBody":"It does what it promises to do, and does it very well. I appreciate that it keeps a log of changes made, which prevents many mistakes. A client's SPF record would have way too many lookups, but AutoSPF makes that problem go away. The length of the SPF record is typically not the issue; it's the amount of lookups in the record that are. AutoSPF \"flattens\" the record, automatically expanding the defined lookups to IP addresses or ranges. And it auto-updates the record when the un-flattened lookups change.","name":"AutoSPF Flattens SPF Records Seamlessly & Keeps Changes Logged - I am quite pleased with the product","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}},{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Verified User","jobTitle":"Financial Services"},"datePublished":"2025-07-31","reviewBody":"AutoSPF did exactly as described, it helped us get past our 10 lookup limit. Afterwards, we hit another limit regarding overall capacity and when contacted, they quickly provided us with a new solution to eliminate capacity issues entirely going forward, so now we can add as many SPF records as needed. They also provided us with a personalized support video explaining their new method in its entirety using our instance as the example.","name":"Helped us go beyond capacity","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}},{"@type":"Review","reviewRating":{"@type":"Rating","ratingValue":5,"bestRating":5},"author":{"@type":"Person","name":"Greg F."},"datePublished":"2023-07-26","reviewBody":"AutoSPF was easy to initially set up on our own and a great cost effective entry into spf flattening. Needed our first support assistance today and got great response including a video demonstrating the issue I was trying to solve, a quick fix, and more detailed followup.","name":"Great service and great support","publisher":{"@type":"Organization","name":"G2","url":"https://www.g2.com"}}]}
```
