Setting up a GoDaddy forwarding address on an AWS Route53 hosted domain
GoDaddy offers free Email forwarding with all domains acquired through them, but what if you don’t like GoDaddy DNS service and want to use Route53? Would still be nice to take advantage of GoDaddy’s free offerings right?
Activate email forwarding in GoDaddy
First, you need to activate the email forwarding offer and set up the forward in GoDaddy.
- Go to the GoDaddy My Products page
- Scroll down to the Additional Products section and under Email Forwarding select the Redeem option
- Choose the domain name for which you want to activate email forwarding from the drop and select the Redeem Credit option
- Back on the My Products page, go to the Workspace Email sections and click the Manage All link
- Find the domain name selected on step 3, and click the Create Forward option
- Fill in the details for the email forward. When done click the Create button
- Forward this email address: The address of the email account
- To these email addresses: The email address where the email will be forwarded to
- Catch-all: Enable this option if your emails sent to any account that does not exist to be handled by this forward
Once this is complete, the new address will show on the list for the domain with the following alert message: “Pending Setup: Validating MX Record”
Creating email validation MX record in AWS Route53
Now you need to create an MX (mail exchange) record for the domain in AWS Route53 in order for GoDaddy to accept the forward.
Creating MX record in AWS console
- Head to Route 53 in the AWS console
- Select the Hosted Zones area
- Select the Domain name for where you created the forward to
- Click the Create record button
- Leave the Record Name blank
- On the Record Type dropdown select the MX – Specifies mail servers option
- Value enter a second line with “10 mailstore1.secureserver.net”, a priority of 10 gives it a lower priority
- Still on the For the Value enter “0 smtp.secureserver.net”, 0 gives it the higher priority. Note that these are deliberately set in reverse order because that is how GoDaddy reads them
- Clock the Create records button to confirm
The new MX record should now display on the list of record names for the domain. You may need to wait some time for the DNS propagation to take place.
Creating MX record with terraform
If you use terraform, then creating the MX record in Route53 is much simple, here’s an example how:
# Require AWS terraform provider to interact with Route53
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4"
}
}
# Using locals for simplicity, real world should use a var
locals {
# This is ID for the AWS Hosted Zone of the domain
hosted_zone_id = 'example_id'
}
# GoDaddy MX Record
resource "aws_route53_record" "godaddy_mx" {
zone_id = locals.hosted_zone_id
name = ""
type = "MX"
ttl = 300
records = [
"0 smtp.secureserver.net",
"10 mailstore1.secureserver.net"
]
}
Testing that the email forward works
Now you want to confirm that everything is working as expected.
The drill command line tool can be used to get information out of DNS records, here’s an example, {DOMAIN_NAME} is a placeholder for the actual domain name. If the MX record is set up correctly the Answer Section will return the two MX records previously set.
$ drill MX {DOMAIN_NAME}
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 12345
;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; {DOMAIN_NAME}. IN MX
;; ANSWER SECTION:
{DOMAIN_NAME}. 300 IN MX 0 smtp.secureserver.net.
{DOMAIN_NAME}. 300 IN MX 10 mailstore1.secureserver.net.
;; AUTHORITY SECTION:
;; ADDITIONAL SECTION:
;; Query time: 37 msec
;; SERVER: 127.0.0.1
;; WHEN: Tue Jun 28 11:09:31 2022
;; MSG SIZE rcvd: 100
Alternatively, an online tool such as DNS Checker can be used o confirm that the MX record is being set for the domain.
Head back to the Workspace Email section under the GoDaddy products page. If the alert still shows, you can check what the error is by selecting the alert and clicking the MX record settings under the Where can I check my MX record settings section.
Note that you are only interested in the MX records because this is a forward, so the alert may still show because the Host Names are not set. This can be ignored because a forward does not actually use the GoDaddy mailboxes.
Now send an email to your forwarding address. You should receive the email back at the destination address you selected.