Last updated: 5 April 2021

DNS is quite flexible. If you want you can host your website on one server and your email on another. This article looks at three common DNS configurations. The DNS records mentioned in this article are explained in our article about Common DNS records.

Host your website and email on the same server

For this article I use the domain The domain is hosted on our Strawberry server, which has the IP address By default, the DNS zone contains the following DNS records:                 A
www                          CNAME
webmail                      CNAME                 MX (0)                 MX (100)                  TXT       v=spf1 mx a ~all

Here, everything points to, apart from the second (fall-back) mail server. Website traffic for and go to, and incoming emails are also be routed to The SPF record is our global SPF record.

Host your website elsewhere but keep email on our servers

You need to make two changes if you want to host your website elsewhere and keep your email on our server. The first change is easy enough: you need to change the A record so that it points to the new server. Next, you need to make sure that the MX record still points to our server.

In the below example the new A record for is The primary MX record can no longer point to I therefore added an A record for that points to and pointed the MX record to                 A
www                          CNAME
webmail                      CNAME
mail                         A                 MX (0)                 MX (100)                  TXT       v=spf1 mx a ~all

An alternative is to point the MX record to the server’s hostname. In this case the MX record can point to In other words, you just need to make sure that the MX record resolves to the server’s IP address (here

Also, note that you don’t have to change the SPF record. The record tells receiving mail servers that is allowed to send mail from both the domain’s A and MX record. The record is still correct, even though both the A and MX record have changed.

Host your email elsewhere but keep the website on our servers

It is of course also possible to host only email elsewhere. In that case you need update the MX records:                 A
www                          CNAME                 MX (1)                 MX (5)                 MX (5)                 MX (10)                 MX (10)                  TXT       v=spf1 a ~all

In this case I also updated the SPF record. Often you don’t need to do so, as the SPF record already allows mail from the MX record. However, it is always best to use the SPF record suggested by your email provider.

Host everything elsewhere

There is one other possible scenario: hosting both your website and email elsewhere. This can be useful if just want a friendly control panel to manage the DNS for your domain.                 A
www                          CNAME                 MX (1)                 MX (5)                 MX (5)                 MX (10)                 MX (10)                  TXT       v=spf1 a ~all

The above DNS records send website traffic to and email traffic to G Suite.