Long explanation in AWS Routing traffic for subdomains – Amazon Route 53
GROUND RULE or RULE OF THUMB of DNS, NEVER change the NS record of your domain in your Domain registrar before completing setup of your DNS server. The result may cause 72 hours of outtage.
Using my domain karmeng.my as an example, the objective is to have chow.karmeng.my to be a valid domain for email hosting which offers customed domain.
Let say, I wanted to create a vanity email me@chow.karmeng.my , default DNS settings in AWS Lightsail does not allow such customization of DNS by allowing a subdomain with a MX record to be created in AWS Lightsail DNS.
Therefore, in order to accomplish such feat, AWS Route 53 are chosen.
First I will need to create 2 DNS Zones in AWS Route 53
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22133714/image-1024x527.png)
Then, in each of the zone create an A record that points to my AWS Lighsail instance static IP.
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22133839/image-1.png)
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22133900/image-2.png)
Based on the article, Routing traffic for subdomains – Amazon Route 53
Create NS records in the parent domain which points to the NS records of the subdomain.
Take the record of the NS from your sub domain, in this case, chow.karmeng.my
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22134605/image-4-1024x569.png)
Create NS records for the subdomain in the parent domain, in this case, karmeng.my
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22134338/image-3-1024x652.png)
Once, the NS are added into the parent domain. Do change the NS of your domain from your domain registrar, do take note that the UI to change your domain NS differs from domain registrar to domain registrar.
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22134902/image-5-1024x299.png)
Finally, test and verify from your local machine.
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22135347/image-6.png)
Check it from your host/server in AWS
![](https://689f472d86992970f26d1f09443b17ed30fec836.s3.ap-southeast-1.amazonaws.com/wp-content/uploads/2023/12/22135710/image-7.png)
Right now both localhost and server in AWS shows everything looks good and dandy. Do check again if in doubt, as DNS propagation will take time to have the effect take into the entire internet. This concludes how to perform DNS routing traffic for subdomains using AWS Route 53.