Excuse my newb-ness at the technical aspects of domain records and the like, but I have a question that somebody on here will be much more suited to answer.

My domain example.com was purchased through GoDaddy. Until recently said domain was being used with HostGator. The nameservers were set in GoDaddy and an addon domain added to HostGator.

Recently I made the switch to host this website on GitHub. To get this working, I removed the nameservers from the domain on GoDaddy and set the A Record to point at GitHub. The domain name is now working fine.

My question is: On HostGator, I had mail forwarding set up for me@example.com through cPanel. Is there a way that I can change the DNS records of my domain on GoDaddy so that I can host on GitHub but manage that email address through HostGator?


When sending E-Mail, the mail servers look up specific DNS records called MX records. This is in contrast to looking up the IP address for, say, a website which uses an A record. If you configure your DNS records (on GoDaddy) so that the MX records points to HostGator's mail servers you should get the result you're looking for.

  • You can find your current MX records with the command dig MX example.com. – Ladadadada Dec 14 '11 at 15:22
  • Thanks, this is setting me in the right direction. How does HostGator (or any host, as a generality) receive this on the other end? Would I keep my domain set up just the same as it was before or would something need to be changed? – Mike Dec 14 '11 at 15:43
  • Mike: If you've configured HostGator to accept mail on your behalf already, and you know the mail server names you should be all set. These sorts of questions aren't answered generically as each mail sevrer is provisioned by the company in question. Some use tools like Plesk, cPanel, etc. while others have proprietary tools or manage it themselves (i.e. no self-service). – Kyle Smith Dec 14 '11 at 17:38

I assume your name servers are set to GoDaddy, and you've just changed the A record for www to point to github servers. As @Kyle Smith said, you'll need to add an MX record.

First thing to do, is check with hostgator what hostname or IP the mail server is for your services with them. If they give you a hostname (this is preferred), add an MX record on your domain to point it to this hostname. They may give you a few with different priorities, just put them into GoDaddy with the same priorities that they give them to you*.

Alternatively, they may give you an IP address. In this case, you should set up an MX record for mail.yourdomain.com, then set up an A record for mail.yourdomain.com pointing to the IP address they gave you.**

In both cases, you do not need to do anything on hostgator, only on the domain.

(* ) Lower number = higher priority. If someone sends you mail, their smtp server will try to send to the server in the MX records with the lowest priority first, then try the next one if that is down etc.
(**) These may already be set up automatically by godaddy (probably pointing to godaddy servers), so just modify them if they are

In terms of how the host receives this (brief explanation); as partially mentioned above, someone clicks to send an email to you, the email goes to their smtp server, the smtp server looks at the MX records for the domain the email is being sent to, it looks up the IP address of the lowest priority MX record and sends the email to that IP. The hostgator server receives the email, and can then forward it on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.