Connect Your Domain to Web Hosting Without Breaking Email
When you point your domain at a new host, the website is usually the easy part. Email is what breaks. Squarespace's help page on nameservers says email settings must be re-added at the new provider after a nameserver switch. Skip that step and your email can stop working. The steps below work with any domain company: pick a method, make the change, wait, check it, and finish with your site on https://.
Nameservers or A record: which should I use?
Change only the A record if email or other services already run on your domain. Use nameservers if the domain is empty or your host runs your email.
The difference is how much moves. A nameserver switch hands all your records to a new provider, and your email records have to be added there again. An A record points one name, such as yourdomain.com, to your host's IP address, and everything else, including email, stays where it is.
What should I gather before I change anything?
Get three things ready before you touch DNS.
- Your registrar login. The registrar is the company that sold you the domain, and it is often not your host.
- Your host's details: either two or more nameserver names, or the IP address for your site.
- A screenshot or export of your current DNS records. Look closely at the MX and TXT records, because records such as MX and DKIM carry your email setup.
Where do I change it at my registrar?
Open the domain's DNS page or nameserver page at the company where you bought the domain.
Change the A record
The labels vary from one registrar to the next, but the fields are nearly always the same.
- Open the domain and go to its DNS records page.
- Add a new record with type A, or edit the existing A record.
- Enter
@as the name for the main domain. - Enter your host's IP address as the value, then save.
Change nameservers (Squarespace example)
- Open the domains dashboard and click your domain.
- Go to DNS, then Domain Nameservers, then Use Custom Nameservers.
- Enter the nameservers and save.
Any other registrar
Look for DNS records or nameservers on the domain's page.
How do I keep my email working?
Use the A-record method. If you switch nameservers instead, re-create every email record at the new DNS provider.
Records do not move on their own when you switch nameservers. Copy these from your screenshot:
- MX records.
- Other email records, such as SPF and DKIM.
Then add the www record your host gives you. Remove any old A or AAAA record that still points to the old server, or some visitors may keep landing on the old host.
If your email moves to your new host as well, set up your mail apps once the new records are in place.
How long does DNS propagation take?
Plan for up to 48 hours, the window registrars such as Squarespace tell you to allow. Changes can show up sooner.
Don't edit the records again while you wait. Every extra edit makes it harder to tell which change you're looking at.
How do I check that it worked?
Run nslookup in a terminal and confirm that your host's nameservers and IP address come back.
Open Command Prompt on Windows, or Terminal on macOS or Linux. On Linux, install the dnsutils or bind-utils package if nslookup is missing. Replace yourdomain.com with your domain. The -type option asks for one record type only, as Microsoft's nslookup reference describes.
Copy-and-run check
nslookup -type=NS yourdomain.com
nslookup -type=MX yourdomain.com
nslookup yourdomain.com
nslookup www.yourdomain.com
curl -sSI https://yourdomain.com
curl -sSI https://www.yourdomain.com- Line 1 shows your new nameservers, if you switched them.
- Line 2 should match the mail records in your screenshot.
- Lines 3 and 4 should both return your host's IP address.
- Lines 5 and 6 come after you turn on HTTPS. You should see response headers and no error message. A certificate problem prints an error instead. On Windows 10 or 11, type
curl.exeinstead ofcurl.
Also open the site on a phone using mobile data, not your office Wi-Fi.
Why do I still see my old site after changing nameservers?
Either you're still inside the wait time, or an old A or AAAA record still points to the old server.
Run lines 3 and 4 of the check. If they show the old IP and your change is less than 48 hours old, wait. If the wait has passed, open your DNS records again and delete or update every A and AAAA record that still names the old server.
When should I turn on HTTPS?
Turn it on last, once the check shows your host's IP for both the bare domain and www.
Free certificates from Let's Encrypt commonly prove control by fetching a file from your domain over port 80. So the domain must already reach the new server.
- Open the free certificate option in your hosting control panel.
- Include both yourdomain.com and www.yourdomain.com.
- In Chrome, open https://yourdomain.com. The page should load without the full-page "Your connection is not private" warning. To see the certificate details, click the icon to the left of the address. Chrome has shown no padlock there since 2023, as the Chromium team announced.
- Run lines 5 and 6 of the check.
Keep it from failing quietly
Confirm that your host renews the certificate on its own. A renewal you plan to do by hand is the one that gets missed. Then add an outside uptime monitor that checks your https:// address and emails a real person if the site goes down or the certificate gets close to expiry. Don't run that check on a laptop that sleeps.
What are the common mistakes?
Most trouble comes from the same few places.
- Email stops after a nameserver switch. The old records were never added at the new provider. Re-add all your email records there, such as MX, SPF and DKIM, or switch back and use the A-record method.
- The domain stops working after a switch to custom nameservers. Usually a setting called DNSSEC, which signs your records, was left on. Squarespace prompts you to turn it off before switching. Turn it back on later only with your new DNS provider's settings for it.
- The certificate request fails, or the browser warns that the connection is not private. Wait until nslookup shows the new IP for both names, remove any old AAAA record, and make sure port 80 reaches the server. Then request the certificate again.
How does this work at PomeloHost?
PomeloHost web hosting includes free SSL. One control panel covers sites, email and domains. Free migration covers an existing website up to 200 GB on 12-month and longer terms. Ticket support runs 24/7, and people answer it.
What is the short version?
Decide the method first, protect email, wait, check, then turn on HTTPS.
- Screenshot your current records.
- Pick the A record if email already runs on the domain.
- Re-create email records if you switch nameservers.
- Add www and remove old records.
- Wait without editing.
- Run the check from any computer.
- Turn on HTTPS for both names, then set up an outside monitor.
Keep your screenshot until email and HTTPS both pass the check. If anything goes wrong, it's what you rebuild from.
Frequently asked questions
Do I have to transfer my domain to my new host to connect it?
No. Connecting and transferring are different jobs. You keep the domain at its current registrar and change either the nameservers or the A record there. You can move the domain later if you want one bill for everything, but the new site will load without it.
Can I undo a nameserver change if something breaks?
Yes. Go back to the same nameserver page at your registrar and enter the old nameservers. The usual wait still applies, so allow up to 48 hours. Records may not come back on their own, so keep your screenshot of the old records and re-add anything that is missing.
Does the www version need its own record?
Yes. The main domain and www are separate names, and each needs its own record. Add the www record your host gives you, check both names with nslookup, and include both when you request the certificate. If www still points elsewhere, the certificate check for www can fail.