GitHub Pages Custom Domain with E-mail Service

After using a custom domain with GitHub Pages, I was quite happy to host on GitHub for free and use a unique workflow. However, after some time I noticed that no emails were coming from the custom domain. It turned out the mail server was not connected.

I searched the internet using the DuckDuckGo search engine but found no clear answers even after going through several pages. On GitHub Pages itself, there is no explanation about how to keep email working properly. After digging deeper, I found a trick to keep email working while the domain still points to GitHub Pages, which is by configuring the DNS zone properly.

FYI, I use dracoola.com for domain and hosting services. Dracoola provides an email service that works well. Since my domain was pointed to GitHub servers, the email traffic was also redirected there and ended up not being delivered.

To solve this, we simply create a new DNS zone that essentially creates a new subdomain called mail pointing to the Dracoola hosting server, then modify the MX records to point to that subdomain.

Create an A record that points to the Dracoola server IP or the server IP that provides the email service. Example: 10.1.10.1 A mail.potato.id

Then create an MX record that points to the A record created earlier. Example: MX 10 mail.potato.id

The number 10 is the priority. The smaller the number, the higher the priority. If there is more than one MX record, the mail server will either randomize or follow the defined priority as shown above.

After that, wait for DNS propagation and check your email again. It should now be connected properly.