Help setting up new hosting account to migrate existing Domain into

MBhelpdesk

New Member
Hi,

I've recently set up a new VPS hosting plan and have an existing domain registered and running with another provider. The intention is to set up the same domain on the VPS to allow the web design company to loaded the new site framework and for us to load content. While this is going on, the existing site continues to run with the other provider until we request them to update the domain nameservers to point at my KH nameservers.

But, I've been having a few problems! If I set up my domain account, say mydomain.com the creation process works fine but I get issues with exim mail from host.mydomain.com as I need to use a remote MX record. So it suggests there's a problem with my DNS setup.

If I set up the DNS zone file to mirror what's currently setup for the MX record my mail freezes from exim and I can't get it to work, not matter what I do. If I delete the DNS zone all works fine. But when I come to switch over the site to KH I have to have a DNS zone set up with all the relevant entries and then get the domain registrar to point at the KH nameservers

Is there a newbie guide to set up a new domain account and migrate a running domain from another hosting provider to KH? Or can somebody give me some good pointers/checklist to follow?

If this a duplicate of an existing thread then please just point me to it?

Thanks.
 
Hello MBhelpdesk,

You didn't say what control panel you are using but I know that cPanel can be configured for an external MX record but I am confused by your saying that your mail freezes with the external MX because isn't that what you want? The external MX server is handling your mail not your local exim so you would not see the local exim handling it, isn't that correct?
 
Thanks for the reply Dan.

I'm using cpanel/WHM. I was thinking about this today and it occurred to me that if I have an external mail service then I probably need to change the MX records for ALL dns zones, i.e. the nameservers, host and domain zone files and not just the domain I created. And as you say exim then won't be handling any mail locally.

Additionally I was thinking ahead to the actual cutover of my existing domain from the current hosting provider who also hold the domain records. So I request them to change the domain records to point at my new nameservers, but would I populate all my additional records for that domain in the zone file for the nameservers or the domain itself?
 
Hi MBhelpdesk,

I'm using cpanel/WHM. I was thinking about this today and it occurred to me that if I have an external mail service then I probably need to change the MX records for ALL dns zones, i.e. the nameservers, host and domain zone files and not just the domain I created. And as you say exim then won't be handling any mail locally.

I wouldn't do this. For one thing the majority of those will never receive email anyways but also just because one domain uses that external MX doesn't mean that they all need to.

For instance I have numerous domains (I also am on cPanel/WHM by the way) that use the local MX. Then I have one for a company that has their own Exchange server so there is an external MX where my VPS acts as backup. Then I have a number of domains that use Google Apps so there are external MXs and my VPS acts as backup again.

If you create the domain and let the system create it's default DNS zone then use the DNS editor to change the MX records when you commit the changes you can let cPanel automatically detect MX records and if it sees that you set it for external MX records it will disable exim for that domain, remove that domain from the localdomains file, and also add the domain to the remotedomains file. Other than changing the MX records it will be pretty automatic.

Additionally I was thinking ahead to the actual cutover of my existing domain from the current hosting provider who also hold the domain records. So I request them to change the domain records to point at my new nameservers, but would I populate all my additional records for that domain in the zone file for the nameservers or the domain itself?
What additional records are we talking about? If it's all for one domain then they should all be in the dns zone for that domain.
 
So, I've just recreated my domain and left it using the VPS nameservers. I then checked the exim queue on the host (not the domain) and it stalled. I then updated the domain zone file and changed the MX. When I saved this I got the message:

zone mydomain.com/IN: NS 'ns1.mydomain.com' has no address records (A or AAAA) zone mydomain.com/IN: NS 'ns2.mydomain.com' has no address records (A or AAAA) zone mydomain.com/IN: not loaded due to errors.

The updates I made to the domain zone file looked ok - added an A record for mail.mydomain.com and updated the MX to:

mail 14400 MX IN mail.mydomain.com

A DNS lookup then returns:

nslookup mail.mydomain.com
;; Got SERVFAIL reply from 127.0.0.1, trying next server
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: mail.mydomain.com
Address: XXX.XXX.XXX.XXX

I then flushed the exim queue on the host and mail is now being delivered. Previously when I created the domain I checked the option to use the nameservers at the domain registrar. So this is progress, although the error I get from the DNS zone file update concerns me as this is suggesting something is missing in the nameserver zone files?

To answer the last query, yes all the additional records are specifically for the domain, e.g. a subdomain for an external blog and online store etc. so thanks for confirming that they need to go in the domain zone file.
 
The error clearly says there's no address records for the nameserver, ie. your zone doesn't have

Code:
ns1.mydomain.com.   IN   A  <ns1_ip_address_here>
ns2.mydomain.com.   IN   A  <ns2_ip_address_here>

because of this error the zone was not loaded by the nameserver therefore it returns SERVFAIL when asked to resolve names from this particular zone.
 
That makes sense, so I added these entries and now the mail queue on the host is frozen again?? So I'm back at the point I was originally and I don't quiet understand how to resolve this.

It seems there a conflict going on now that my host resolves mail.mydomain.com to the correct external address but it's using a local MX host.mydomain.com and my host is set up to send mail to an external email <helpdesk@mydomain.com>

2012-09-13 04:30:55 cwd=/var/spool/exim 4 args: /usr/sbin/exim -odi -Mc 1TC4nF-00036b-TJ
2012-09-13 04:30:55 1TC4nF-00036b-TJ remote host address is the local host: mydomain.com
2012-09-13 04:30:55 1TC4nF-00036b-TJ == <helpdesk@mydomain.com><root@host.mydomain.com> R=lookuphost defer (-1): remote host address is the local host
2012-09-13 04:30:55 1TC4nF-00036b-TJ Frozen
 
I've made no changes to the exim config file and I can't find anything in there that suggest I have mydomain.com as a local domain.

If I switch my resolv.conf to point DNS to resolve externally then exim works ok:

root@host [/etc]# exim -bt <helpdesk@mydomain.com>
<helpdesk@mydomain.com>
router = lookuphost, transport = remote_smtp
host mail.mydomain.com [XX.XXX.XX.XX] MX=100

If I switch it back to the default config with localhost first:

root@host [/etc]# exim -bt <helpdesk@mydomain.com>
LOG: MAIN
remote host address is the local host: mydomain.com (while routing <helpdesk@mydomain.com>)
<helpdesk@mydomain.com> cannot be resolved at this time: remote host address is the local host

So I'm only seeing an issue when my host is trying to resolve from itself. Could this be an issue because my host and domain are only currently visible as IPs on the internet? At present the domain mydomain.com is hosted by another provider using their nameservers.
 
Hi MBhelpdesk,

The domain (including MX records) will not resolve until you change your nameservers at the registrar, that sounds to be part of the problem that you are seeing. Once you create the domain on your KH machine it knows that it should be hosting it but it is unable to resolve because the NS information at the registrar is different so...no traffic. This is normal and expected until the nameservers are changed.
 
Top