我尝试了几种方法(GUI、命令行、带引号、不带引号),但我无法将 DKIM 记录添加到谷歌 DNS。我们正在将所有记录移植到谷歌 DNS,然后打开谷歌 DNS(如果我们可以先让它工作)。这是添加记录并执行事务和输出的最后 2 个命令:
Deans-MacBook-Pro:authservice dean$ gcloud dns --project=orderly-gcp record-sets transaction add \"v=DKIM1\;\ k=rsa\;\ p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqiC1U9FnYKnw3tJ/kvISikBBAUZWrDYNYV4q0lN\+z7PjVIh5tk86b4jBvFzcR6ug3hD02JNgphEdGbYmFtjjfxN1gXVp61aRM/yJUw2oMNRXsmmUzE4Hl3yUQihJkE\+lvDWZDx\+S4MIb4KlRvdkEmRG4fowQxb4AAXf\+FaKbf8h9VZ3O2KqV18P0OoDjlJMyOOePSnf8Hgsym246M1aIhpBQM34X2/gY4dpBeFXG\+dEWq7TICQEKXKypYIhsJDxCj03jL/ro8AoWyhQ5Lz6H3/g1RIsuzAJtVlmlSoZOn/lyHFKyh/\+kkt/jyrE6DNN7JXTxXZBdE5yKsdG3zkYBqwIDAQAB\" --name=google._domainkey.orderlyhealth.com. --ttl=300 --type=TXT --zone=orderlyhealth
Record addition appended to transaction at [transaction.yaml].
Deans-MacBook-Pro:authservice dean$ gcloud dns --project=orderly-gcp record-sets transaction execute --zone=orderlyhealth
ERROR: (gcloud.dns.record-sets.transaction.execute) HTTPError 400: Invalid value for 'entity.change.additions[1].rrdata[0]': '"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqiC1U9FnYKnw3tJ/kvISikBBAUZWrDYNYV4q0lN+z7PjVIh5tk86b4jBvFzcR6ug3hD02JNgphEdGbYmFtjjfxN1gXVp61aRM/yJUw2oMNRXsmmUzE4Hl3yUQihJkE+lvDWZDx+S4MIb4KlRvdkEmRG4fowQxb4AAXf+FaKbf8h9VZ3O2KqV18P0OoDjlJMyOOePSnf8Hgsym246M1aIhpBQM34X2/gY4dpBeFXG+dEWq7TICQEKXKypYIhsJDxCj03jL/ro8AoWyhQ5Lz6H3/g1RIsuzAJtVlmlSoZOn/lyHFKyh/+kkt/jyrE6DNN7JXTxXZBdE5yKsdG3zkYBqwIDAQAB"'
我尝试将在线
re2.xxx.xxx
生成的 DKIM 记录添加到我的测试项目中 的测试域:1582300947.xxx._domainkey.re2.xxx.xxx
v=DKIM1;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNGban25809+iUFrb1Eg3Hlt1KiVsE6/ug+ifhJ31eYisjcFHVbJ5HE76uuLHXEPnAPfGnAkOo2EWuZSUCOb/8uaI/NMu99vtvXw+egoK8yQ/t0GpY7TGtm/IFRNEHt3W/R98WkQJdygX7vb/9Vel+BR+hbVw/gI/c8VOKqOxH2QIDAQAB
用户界面:
DNS name
:1582300947.xxx._domainkey.re2.xxx.xxx
TXT data
:"v=DKIM1;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNGban25809+iUFrb1Eg3Hlt1KiVsE6/ug+ifhJ31eYisjcFHVbJ5HE76uuLHXEPnAPfGnAkOo2EWuZSUCOb/8uaI/NMu99vtvXw+egoK8yQ/t0GpY7TGtm/IFRNEHt3W/R98WkQJdygX7vb/9Vel+BR+hbVw/gI/c8VOKqOxH2QIDAQAB"
之后我用命令检查了 TXT 记录:
它有效。
命令行:
它也可以按预期工作:
更新查看有关选择资源记录类型的文档详细信息:
如果您的 DKIM 记录包含超过 255 个字符,则应将其拆分。例如,将 DKIM 密钥拆分为如下两部分:
除了上面的文档,请查看这篇文章。