Skip to content

Commit

Permalink
Adding DKIM example
Browse files Browse the repository at this point in the history
Closes timohirt#54 
Info is taken from timohirt#54 (comment)
  • Loading branch information
ThomasLandauer authored Mar 27, 2023
1 parent f5310c0 commit 77fdd3a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,20 @@ resource "hetznerdns_record" "example_com_spf" {
value = jsonencode("v=spf1 ip4:1.2.3.4 -all")
type = "TXT"
}
# DKIM record
locals {
dkim = "v=DKIM1;h=sha256;k=rsa;s=email;p=abc..."}
}
resource "hetznerdns_record" "example_com_dkim" {
zone_id = hetznerdns_zone.example_com.id
name = "default._domainkey"
type = "TXT"
# Since the maximum length of a DNS record is 255, it needs to be split in 2 parts:
value = join(" ", [
jsonencode(substr(local.dkim, 0, 255)),
jsonencode(substr(local.dkim, 255, 255)),
""
])
}
```

0 comments on commit 77fdd3a

Please sign in to comment.