ExternalDNS is an open-source tool that automates the management of public DNS records for Kubernetes resources such as services and ingresses, that are publicly exposed outside the cluster.
The ExternalDNS solution offers the following capabilities:
Control to developers to manage DNS resources that are usually managed manually by third teams. Example: Infrastructure team.
Ensures that the DNS records are always up-to-date with the current state of the Kubernetes cluster.
Manages a large number of records automatedly.
Simplifies the management of DNS records with improved security.
Prerequisites: Ensure that you have the following before you begin:
A domain name that is registered with your domain provider aka Registrar or a subdomain under your control.
A token from a user with privileges to manage zones and records with Cloud DNS.
An IONOS Managed Kubernetes cluster.
The kubectl installed on your local machine.
The Helm tool for installing a Helm chart.
Follow these steps to set up ExternalDNS for your Managed Kubernetes with IONOS DNS Provider Cloud DNS:
Prepare domain name: You need to first Create a DNS Zone for your domain name with Cloud DNS and then Connect Domain Name to Cloud DNS.
Add Helm chart: Add the Bitnami Helm repository, which contains the official external-dns Helm chart.
Create configuration: Create values file for ExternalDNS Helm chart that includes the plugin configuration. In this example, the values file is called external-dns-ionos-values.yaml.
Install ExternalDNS: To install ExternalDNS with Bitnami Helm chart, use the following commad:
Deploy application: Follow this step to deploy an application:
Deploy an echo server application by using the file echoserver_app.yaml.
If you want to use a service, you do not need to install an ingress controller. You can install an ingress controller in the cluster and deploy the application with kubectl by using the following command:
Result: The deployment of ExternalDNS on Managed Kubernetes is complete.
You can verify that the application deployed is functioning as expected by using one of the following options.
Check that the echo server app runs on the subdomain you have specified by using the following command:
Expected result:
Check that the new A and TXT records are created by using the following command:
The tutorial guides you through the commonly referred topics in the Cloud DNS such as:
ExternalDNS: Cloud DNS offers ExternalDNS integration that makes Kubernetes resources discoverable via the public DNS servers. For more information, see tutorial.
Set Up a Secondary Zone: Guides you through how to set up a primary zone in IONOS Cloud Dedicated Core server and a secondary zone with Cloud DNS. For more information, see tutorial.
Enhance email deliverability with a reverse DNS record: Guides you through how to create a reverse DNS record and an SPF record for your domain name. For more information, see tutorial.
A PTR (Pointer) record is crucial for a mail server as it establishes a Reverse DNS mapping, verifying the legitimacy of the server's IP address. This record is vital for email deliverability, preventing emails from being flagged as spam during Reverse DNS checks. It contributes to forward-confirmed Reverse DNS (FCrDNS), aligning forward and Reverse DNS entries to enhance server credibility. Servers lacking a valid PTR record may face rejection by other mail servers, impacting deliverability. Overall, a PTR record is a standard best practice, promoting trustworthiness and smooth email communication. Additionally, an SPF (Sender Policy Framework) record is essential for email deliverability, as it specifies authorized mail servers for a domain, preventing email spoofing and further bolstering the authenticity of outgoing emails.
This tutorial will guide you on how to install and configure a mail server and a PTR record using IONOS . The steps we will follow are:
Set up a Dedicated Core server in IONOS Cloud.
Create an A and MX record for your mail server.
Install and configure mail server.
Add a Reverse DNS record and SPF record for your mail server.
Test the email deliverability.
Note:
The user who creates the server has full root or administrator access rights. A server, once provisioned, retains all its settings (resources, drive allocation, password, and so on), even after server restart at the operating system level.
The server will only be removed from your virtual data center once you delete it in the DCD.
To set up a Dedicated Core server in IONOS Cloud, follow these steps:
1. Create a Dedicated Core server and configure the server in the Settings tab by following the steps in .
Result: A Dedicated Core Server is set up and started along with the configuration of Settings, Network, and Storage setup.
2. MAC: Assigned on VM creation.
3. LAN: Select the LAN connection that is connected to the internet, by default LAN 1.
4. Firewall: By default, the firewall is disabled. To enable firewall rules, make sure that incoming and outgoing traffic is allowed on port 25 for UDP and TCP.
5. IP Management: To reserve an IP for the server, click IP Management under Management in the top menu bar.
6. Click Reserve IP and a new pop-up window Reserve IP appears. Add a Name, Number of IPs and select a region that is the same as the region of your Dedicated Core server. Click Reserve IP to reserve the IP and confirm the reservation by pressing OK.
7. Exit the IP management window and return to the Network tab of your Dedicated Core Server.
8. In the IPv4 Configuration click Add IP and a select one of your reserved IPs.
Result: The Network settings for a Dedicated Core server are configured.
Warning: The storage type cannot be changed after provisioning.
1. Click SSD and a new pop-up window Create New Attached Storage appears.
2. Configure the following storage details:
Name: Enter a name that is unique within your VDC.
Availability Zone: Leave on "Auto".
Size in GB: Enter "50" which is sufficient for this tutorial.
Performance: Select "Standard".
Image: You can select one of IONOS images or snapshots, or use your own. For this tutorial, we will use an Ubuntu server image from IONOS. To make the same choice, select ubuntu-22.04-server-cloudimg-amd64 under IONOS Images.
Password: Create a password for the "root" user of the server. You will need this password to SSH and make changes.
SSH Keys: Select an SSH key stored in the SSH Key Manager.
Ad-hoc SSH Key: If you have not created an SSH key, copy and paste the public part of your SSH key into this field.
Cloud-Init user data: Leave on "No configuration".
Boot from Device: Select this checkbox to make the SSD drive bootable.
3. Click Create SSD Storage to create the SSD storage.
Result: The Storage settings for a Dedicated Core server are configured.
1. Select the newly created Dedicated Core server.
2. From the Settings tab in the Inspector pane, select Power > Start.
3. Click Provision Changes in the lower right corner and further click Provision Now.
Result: The Dedicated Core server is provisioned and started.
Next steps: After your changes are provisioned and the server is started, select your Dedicated Core server, click the Network tab in the Inspector pane and copy one of the IPv4 addresses.
Replace <zone_id> with your zone id.
1. Connect to your Dedicated Core server via SSH:
and make sure that you are executing the following commands as root.
2. Update the system:
If a kernel is updated it is suggested that you reboot the server.
3. Install Postfix:
Follow the on-screen prompts to configure Postfix. Select Internet Site and enter the domain name of your mail server, in this tutorial we will use our domain mail.demo-ionos.cloud
.
4. Install OpenDKIM:
5. Generate OpenDKIM keys:
Execute the following commands to generate OpenDKIM keys for your domain and move them to the appropriate directory:
Replace mail.demo-ionos.cloud
with your domain name.
6. Edit the OpenDKIM configuration file:
Add or modify the following lines:
Replace mail.demo-ionos.cloud
with your domain name.
7. Install Postfix and Mailutils:
Follow the on-screen prompts to configure Postfix. Select Internet Site and enter the domain name of your mail server, for example, demo-ionos.cloud
.
7. Configure Postfix to use OpenDKIM:
Modify the line containing information about smtp_banner
to include the domain name of your mail server, for example, mail.demo-ionos.cloud
. The line should look like this:
and add the following lines at the end of the file:
and the complete /etc/postfix/main.cf
file looks like this:
8. Restart services:
9. Test the configuration:
Replace <your-email>@<your-domain>
with your email address.
In your mailbox you should receive an email with the subject "Test Email" and the body "This is a test email" but it might be in the spam folder, depending on your email provider. In our case the email was in the spam folder with a note "Mail system could not verify that demo-ionos.cloud actually sent this message (and not a spammer)."
10. Check the mail log:
For your SPF record make sure that instead of mail.demo-ionos.cloud
you use your own domain name.
After creating the PTR record and the SPF record, it might take around 10 minutes to propagate.
3. Test again the email deliverability:
Replace <your-email>@<your-domain>
with your email address.
2. Configure the server Network settings by following the steps in the .
3. Configure the server Storage settings by following the steps in the .
4. Continue to provision the changes and start the Dedicated Core Server by following the steps in the .
In the > Inspector pane on the right, configure the following network details in the Network tab.
1. Name: Choose a name unique to this .
In the > Inspector pane on the right, configure the following storage details in the Storage tab.
1. Create an A record for demo-ionos.cloud using IONOS :
We already own the zone mail.demo-ionos.cloud
and we will use it for this tutorial. Previously we have created a zone demo-ionos.cloud using IONOS . To get more information how to create a zone using IONOS , please refer to .
For more information on how to create a record for a zone using IONOS , please refer to . In the above example make sure to use your own <zone_id>
and <your_server_ip>
along with your <authorization token>
.
2. Create an MX record for demo-ionos.cloud using IONOS :
For more information on how to create a record for a zone using IONOS , please refer to .
1. Create a PTR record for your mail server using IONOS :
2. Create an SPF record for mail.demo-ionos.cloud
using IONOS :
This tutorial explains how to set up a secondary DNS zone in IONOS Cloud by running a bind9 server on an Ubuntu operating system. The setup includes the following configuration steps:
Set up a Dedicated Core server in IONOS Cloud.
Configure a primary nameserver on a Dedicated Core Server in IONOS Cloud running a bind9 server on an Ubuntu operating system.
Create a secondary DNS zone using IONOS Cloud DNS API.
Establish and verify the zone transfer between primary and secondary zones.
Note:
The user who creates the server has full root or administrator access rights. A server, once provisioned, retains all its settings (resources, drive allocation, password, and so on), even after server restart at the operating system level.
The server will only be removed from your virtual data center once you delete it in the DCD.
To set up a Dedicated Core server in IONOS Cloud, follow these steps:
1. Create a Dedicated Core server and configure the server in the Settings tab by following the steps in Create a Dedicated Core Server.
2. Configure the server Network settings by following the steps in the Dedicated Core Server network settings.
3. Configure the server Storage settings by following the steps in the Dedicated Core Server storage settings.
4. Continue to provision the changes and start the Dedicated Core Server by following the steps in the Provision changes and starting the Dedicated Core Server.
Result: A Dedicated Core Server is set up and started along with the configuration of Settings, Network, and Storage setup.
In the DCD > Inspector pane on the right, configure the following network details in the Network tab.
1. Name: Choose a name unique to this Virtual Data Center (VDC).
2. MAC: Assigned on VM creation.
3. LAN: Select the LAN connection that is connected to the internet, by default LAN 1.
4. Firewall: By default, the firewall is disabled. To enable firewall rules, make sure that incoming and outgoing traffic is allowed on port 53 for UDP and TCP.
5. IPv4 Configuration: Leave to default values.
Result: The Network settings for a Dedicated Core server are configured.
Warning: The storage type cannot be changed after provisioning.
In the DCD > Inspector pane on the right, configure the following storage details in the Storage tab.
1. Click SSD and a new pop-up window Create New Attached Storage appears.
2. Configure the following storage details:
Name: Enter a name that is unique within your VDC.
Availability Zone: Leave on "Auto".
Size in GB: Enter "30" which is sufficient for this tutorial.
Performance: Select "Standard".
Image: You can select one of IONOS images or snapshots, or use your own. For this tutorial, we will use an Ubuntu server image from IONOS. To make the same choice, select ubuntu-22.04-server-cloudimg-amd64 under IONOS Images.
Password: Create a password for the "root" user of the server. You will need this password to SSH and make changes.
SSH Keys: Select an SSH key stored in the SSH Key Manager.
Ad-hoc SSH Key: If you have not created an SSH key, copy and paste the public part of your SSH key into this field.
Cloud-Init user data: Leave on "No configuration".
Boot from Device: Select this checkbox to make the SSD drive bootable.
3. Click Create SSD Storage to create the SSD storage.
Result: The Storage settings for a Dedicated Core server are configured.
1. Select the newly created Dedicated Core server.
2. From the Settings tab in the Inspector pane, select Power > Start.
3. Click Provision Changes in the lower right corner and further click Provision Now.
Result: The Dedicated Core server is provisioned and started.
Next steps: After your changes are provisioned and the server is started, select your Dedicated Core server, click the Network tab in the Inspector pane and copy the IPv4 address.
Prerequisite: A Dedicated Core server in IONOS Cloud needs to be set up and you must have the IPv4 address of the server.
To configure a Dedicated Core server and enable it to act as the primary nameserver, follow these steps:
1. SSH into the newly created Dedicated Core server.
2. Connect to the newly created server via SSH.
3. Proceed with configuring bind9 and your primary DNS zone.
4. Configure notify to the IONOS Cloud DNS anycast nameserver and allow zone update from localhost.
Note: For sending DNS notify messages, Cloud DNS uses the following Anycast addresses: IPv4 212.227.123.25 or IPv6 2001:8d8:fe:53::5cd:25.
5. Create your primary zone.
6. Edit the zone file.
7. Save your changes and quit the Vim editor.
8. Check the configuration, reload bind, and verify that the configured zone is working.
Result: The Dedicated Core server is configured as the primary nameserver in IONOS Cloud running a bind9 server on an Ubuntu operating system.
Prerequisite: A Dedicated Core server in IONOS Cloud is set up as a primary nameserver.
To create a secondary zone in the IONOS Cloud DNS by using the REST API, follow this step:
Send a POST request to the /secondaryzones
endpoint.
Result: A secondary zone in IONOS Cloud DNS is successfully created By using a POST request.
On the primary nameserver, you can verify the zone transfer in the logs by executing the following command:
You can also verify zone transfer status using IONOS Cloud DNS API:
On success response: 200 OK
Result: The zone transfer between primary and secondary zones is successfully verified.
To add a record, follow these steps:
1. On the primary nameserver, update the zone with a new record setting—A record to a TEST-NET-3 IP address:
2. Resolve the new record locally.
3. View the logs which show that a notification is sent to the secondary zone for the new record.
4. Using Cloud DNS API, verify that the newly added record is transferred to the secondary zone.
5. Globally resolve a new record from the IONOS Cloud DNS anycast network by using the following command:
Result: A record is successfully added to the primary nameserver.