I have a domain (mydomain.com) with working email (provided by the domain registrar, let's call them ExistingHosting), but no web site. I now want to create a web site, hosting it with a different hosting company (let's call them NewHosting). I want the email to remain with ExistingHosting.
The tech support people at NewHosting advise me to get ExistingHosting to change the nameservers for mydomain.com to point to NewHosting's nameservers, and then to get NewHosting to change the MX Records to point back to ExistingHosting's mail servers.
My question relates to the MX record. The existing MX record (viewable through ExistingHosting's control panel) looks like this:
mydomain.com IN MX mydomain.com (1)
When I ask the tech support people at ExistingHosting how I should set up the MX record (with NewHosting) once the nameservers for mydomain.com point to NewHosting's nameservers, they tell me that I should use the same MX record, as above. But, I was expecting them to say that the MX record would now need to looks something like
mydomain.com IN MX mail.existinghosting.net (2)
My (possibly flawed) understanding is that once the nameservers are changed to point to NewHosting's nameservers, then the first MX record, (1) above, would now (if I'm lucky!) point to mail servers at NewHosting.
So, my question is this: Is my understanding flawed, or are the tech support people at ExistingHosting giving me the wrong advice? Or both :-(
To put it another way, doesn't the second occurrence of
domain.com in MX record (1) provide a host name which is then the subject of DNS look-up, which will now point to NewHosting's (default?) mail servers?
As you may have guessed, I'm a newbie at fiddling with DNS. I want to be absolutely sure of what I'm doing before changing anything.
As a result of responses here (thank you @Ramhound, @Yuri G. and @Tom Ruh), I got back to ExistingHosting and pushed them for the name of their mail host. They responded with the following instructions:
You will be required to add an A record for: mx.mydomain.com pointing to IP 22.214.171.124 and another A record for webmail.mydomain.org. 14400 IN A 126.96.36.199.
(That's not the real IP Addr they gave me!)
They said that with this configuration I won't need an MX record.
I don't understand how that can work. Can it work? If so how? Does the name
mx have a special meaning in
mx.mydomain.com that bypasses the need for an MX record?