2024 January. New install. Had to do this manually. The steps below explain why this must be done manually. imho.
I had no DNS entry for my localhost (server.domain.com), and could not generate the dkim.
grep dkim directadmin.conf
directadmin.conf:dkim=2
! the setting is already set, so no need to change
Steps I took:
1) in the DNS admin I added a new DNS entry for server.domain.com
If I run [root@server scripts]# ./dkim_create.sh $(hostname -f) # I get:
Unable to find /etc/virtual/server.domain.com
Ok, next step:
2) I created the folder: #mkdir /etc/virtual/server.domain.com
and set rights: #chown mail.mail /etc/virtual/server.domain.com
3) run the script again:
[root@server scripts]# ./dkim_create.sh $(hostname -f)
writing RSA key
In DA or SSH check cat /var/named/server.domain.com.db
You should see
x._domainkey 3600 IN TXT ( "v=DKIM1; k=rsa; p=MIIBIjAabcdabcdAabcdabcdAabcdabcd......etcetera " )
In my case, multi DNS is not yet configured, so I go to the DNS manager who own domain.com and I add
x._domainkey.server TXT "v=DKIM1; k=rsa; p=MIIBIjAabcdabcdAabcdabcdAabcdabcd......etcetera "
(yes, the quotes are input as well, but DA will add them for you if you don;t).
Now the main DNS is in sync with the DKIM value of your new server.
If you ever switch on multi-DNS, be sure to remove the manually added record, so DKIM could be updated when needed (I am not sure if this ever happens or is needed)
I did not and will not add server.domain.com as a domain on subdomain on this server! It is just a hostname, and may better be unique (and be pointed to via the IP PTR).
I had no DNS entry for my localhost (server.domain.com), and could not generate the dkim.
grep dkim directadmin.conf
directadmin.conf:dkim=2
! the setting is already set, so no need to change
Steps I took:
1) in the DNS admin I added a new DNS entry for server.domain.com
If I run [root@server scripts]# ./dkim_create.sh $(hostname -f) # I get:
Unable to find /etc/virtual/server.domain.com
Ok, next step:
2) I created the folder: #mkdir /etc/virtual/server.domain.com
and set rights: #chown mail.mail /etc/virtual/server.domain.com
3) run the script again:
[root@server scripts]# ./dkim_create.sh $(hostname -f)
writing RSA key
In DA or SSH check cat /var/named/server.domain.com.db
You should see
x._domainkey 3600 IN TXT ( "v=DKIM1; k=rsa; p=MIIBIjAabcdabcdAabcdabcdAabcdabcd......etcetera " )
In my case, multi DNS is not yet configured, so I go to the DNS manager who own domain.com and I add
x._domainkey.server TXT "v=DKIM1; k=rsa; p=MIIBIjAabcdabcdAabcdabcdAabcdabcd......etcetera "
(yes, the quotes are input as well, but DA will add them for you if you don;t).
Now the main DNS is in sync with the DKIM value of your new server.
If you ever switch on multi-DNS, be sure to remove the manually added record, so DKIM could be updated when needed (I am not sure if this ever happens or is needed)
I did not and will not add server.domain.com as a domain on subdomain on this server! It is just a hostname, and may better be unique (and be pointed to via the IP PTR).