-4

A client want to change their A Record to an other Server respectively IP address. Thats not a problem, but he want to keep their mail service on the old server. So, what entry I need for the MX record, I cannot set there the old IP address, right?

3 Answers3

2

The MX record must point to an A or AAAA record, so no, you can't put in the IP address or a CNAME. But you can just declare an A record, e.g. mail.example.com, pointing to this IP address and then point the MX record to mail.example.com.

Sven
  • 97,248
  • 13
  • 177
  • 225
0

This is often the question when you have to move website or email to new server. Sven said everything, i'd just like to expand with example. So you have old server on 1.1.1.1 and new server on 2.2.2.2. Original zone looked like this:

example.com. in A 1.1.1.1
example.com. in MX example.com.

In this example, both A and MX record are pointing to 1.1.1.1

If you want to change A or MX record and point them elsewhere, you should set dns zone like this:

Website on new server

example.com. in A 2.2.2.2
example.com. in MX mail.example.com.
mail in A 1.1.1.1

Mail service on new server

example.com. in A 1.1.1.1
example.com. in MX mail.example.com.
mail in A 2.2.2.2

RonanW.
  • 419
  • 2
  • 6
  • why would you have different A records for mail.example.com on the two servers? They need to be the same and usually they are as the DNS is running somewhere else entirely. – Sven Aug 19 '16 at 13:35
  • I've made two examples for two different cases. In first case, you are pointing A record elsewhere and keeping mx on current server, while in second case, you're pointing mx somewhere else. I realize that I've moved away from answer, but I guess I've tried to explain both cases. – RonanW. Aug 19 '16 at 13:50
-1

Same domain, just making changes to an A record right? Simple.

You can keep everything for mail set to the old IP. If you show me the zone, I can be more specific. But if you're just changing A records for a website or something, just leave the mail server entries alone so that the MX records are still pointing to something with the old IP address(es).

i.e. Leave mail settings alone

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36
  • You can't make this statement without knowing the records in question. A (stupid but common) scenario is where everything including MX is using `www.example.com` or even pointing to the apex. In that case, you *cannot* leave mail settings alone when moving other records away. – Sven Aug 19 '16 at 13:26
  • @Sven Yes I can. I just did. That's a messed way to setup DNS. Anyways, I said I can be more specific if he showed me the zone. He'd figure out pretty fast he can't follow my instructions if he did something odd like that too. – Ryan Babchishin Aug 19 '16 at 13:41
  • @Seven Everyone is assuming he needs to add new mail server(s)/rewrite his domain. I'm assuming he did it correctly. Every domain I've ever managed (not necessarily setup) could be updated according to the directions I gave. Even the examples given here. I hate how people are always guessing here... OPs don't give enough detail, then I'm wrong because I guessed wrong? You don't know what his zone looks like. – Ryan Babchishin Aug 19 '16 at 13:42
  • @Sven What complicated answers would we see if a user asked how to change a record for a web server or name server? Would everyone guess again? Give complex answers, explaining how DNS works or should we all ask for the zone file next time? This question is incomplete... nobody should have ever answered it. I mean, it's has a -3... it should be closed until additional details are added. – Ryan Babchishin Aug 19 '16 at 13:51
  • 1
    Yes, the original question needs more details, and it shouldn't be answered before further details are given. More details can be asked in comments. – Tero Kilkanen Aug 19 '16 at 13:59
  • 1
    @RyanBabchishin: +1. I agree. There's a bit of an assumption on your part (and mine) that the OP is merely moving the website to a new web host and if that is the case then the answer to the question "What should I do with the MX record?" is **Nothing**. Do nothing with it. Too many times I see web developers monkey around with NS records and MX records because they're moving a website and think that they have to make changes to the NS and MX records in the process. – joeqwerty Aug 19 '16 at 14:01
  • 1
    @RyanBabchishin: As you well know I can register my domain with one entity, host my DNS zone with a different entity, host my email with yet another and host my website somewhere else entirely... or any combination thereof. That's what I think confuses many people. They think that the DNS zone has to be hosted by the same entity that hosts the website, and the same for the MX records. If the OP is simply moving the website then he only needs to change the relevant DNS records for the website and leave everything else alone. – joeqwerty Aug 19 '16 at 14:01