大网数据广告活动
服务器运维问答

can I use multiple selectors for opendkim?

· 52CE 我爱测

I have 4 domains hosted on a single server. Should I use 4 separate dkim keys or one for all of them? Also as far as selectors go do I need to use the one specified in opendkim.conf or can/should I create a new one per each domai…

问题原文

原帖链接 · Marcin Kozyra · CC BY-SA 4.0

I have 4 domains hosted on a single server. Should I use 4 separate dkim keys or one for all of them?

Also as far as selectors go do I need to use the one specified in opendkim.conf or can/should I create a new one per each domain with new key?

社区高分解答

原帖链接 · HBruijn · CC BY-SA 4.0

I have 4 domains hosted on a single server. Should I use 4 separate DKIM keys or one for all of them?

Technically you can use the same key-pair to generate DKIM signatures for all the domains you host on the same mail server. That may be preferable when you host (many) different domains.

  • Publish DKIM record once in the DNS zone for your main domain i.e.
    dkim.example.net. 86400 IN TXT "k=rsa\; p=MIGfMA0GCSq...DAQAB\;"

  • For all your domains you'll need to use the same selector-name and set up domainkey DNS records such as:
    selector-name._domainkey IN CNAME dkim.example.net.

Then set up /etc/opendkim.conf:

KeyTable        /etc/opendkim/KeyTable
SigningTable    refile:/etc/opendkim/SigningTable

In /etc/opendkim/KeyTable:

selector-name  example.com:selector-name:/etc/opendkim/selector-name.key

And in /etc/opendkim/SigningTable map every domain to that single key:

* selector-name

For a limited number of domains I usually generate unique key pairs (opendkim-genkey --domain=example.com --selector=20180717 --verbose) for each domain and maintain the opendkim KeyTable and SigningTable mappings.

In /etc/opendkim/KeyTable:

selector-name._domainkey.example.com  example.com:selector-name:/etc/opendkim/selector-name._domainkey.example.com.key
selector-name._domainkey.example.org  example.org:selector-name:/etc/opendkim/selector-name._domainkey.example.org.key

And in /etc/opendkim/SigningTable map every domain to its own key:

example.com selector-name._domainkey.example.com
example.org selector-name._domainkey.example.org

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-07-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。