When you use domain mail, it is important that not only emails are received and sent, but also that they do not go into spam at the recipients' server.
There are two DNS records that can help: SPF and DKIM. The first one tells the recipient from which servers the mail can be sent from the domain mail, which is necessary when you sending an email to @ukr.net addresses (for example). The second one encrypts your mail.
DKIM record is generated on the hosting server. To get it send an email to firstname.lastname@example.org or create a request through the form "Contact us" → "Apply to support" on the NIC.UA website. In the request specify that you need DKIM-record, hosting order number, and pin-code for support from your dashboard.
SPF record is simple to create based on your hosting order data.
In the record data you specify that this is the SPF record, specify the mail server address, as well as how to deal with letters that were sent from other servers.
For record type use TXT, name @, data starts with v=spf1 and ends with ~all or -all.
Between v=spf1 and ~all you must specify from which server the mail can be sent.
It will be enough to enter:
ip4:IP of the hosting server (for example, ip4:22.214.171.124).
The completed record data will look like this:
v=spf1 +a +mx +ip4:126.96.36.199 ~all
~all - emails from other servers will go into spam.
-all - emails from other servers will be rejected by the recipient's server.
+a +mx - you can also add, in this case A and MX domain records will be checked as well.
You can find it in the hosting order settings.
For this go to the 'Hosting' section in your dashboard and click on the gear near your order.
In the order preferences you will find the "Hosting settings" field. There will be the server name and its IP address in square brackets.
You need to copy this IP address (without brackets) and paste it into the record data after +ip4: as in the example above.
You need to add both records (DKIM and SPF) on name servers for your domain.
If you use NIC.UA name servers to add records, go to the 'Name servers' page.
Click the gear button next to the name servers for your domain.
Click "Edit" next to DNS records
Add two records with type TXT.
Enter names for the records:
- for DKIM - everything before the domain name ( in the example) - default._domainkey;
- for SPF, use @.
Added records on the name servers will be like in the example below.
⚠️Note: after changing NS servers and/or DNS records you will probably need to wait for a few hours for DNS propagation. After that, your mail and website will work.