Error with mail server in DNS record, "Host found but no data record of requested type"


We set up a Postfix email server on our website server, and can send emails, but can’t receive emails there, getting this error on returned emails:
Host or domain name not found. Name service error for name = type = A: Host found but no data record of requested type

We set up an MX record for the emails, but want only emails with the subdomain of "" to be served by it. Emails going to "" are already handled by our server host’s email server. The MX record is set up like so:
MX - subs - mail handled by - we tried too.

The subdomain has a CNAME record set up, but the error message refers to a “type A”, which I assume is the A record. But we can’t set up a separate A record for it, since it uses the same ip as the domain.

On the Linux Centos 7 server we have, we have set up the resolv.conf file with the line “domain” and the namerserver with the correct ip for the server.

I did a “dig mx” check on the server, which seemed to indicate that the DNS is working okay. The “ANSWER” section says “ 300 IN MX 10”

What should we do to get this working?


Your MX configuration appears to be correct, however you do not have a record for You will need to create this otherwise the MX record for subs wont point anywhere.


Should it be another MX record? Or could I just change the MX named ‘subs’ to ‘mail’, so that it can be accomplished with just one MX record? Or do you mean a CNAME record for If that’s what you mean, I already have one for, could I just make an MX record for that? Or could it be It’s all very confusing.

Thanks for your help.


You need an A record for mail.

Once you understand it it is pretty straightforward. The MX record specifies the host of the email server for the domain you want to receive email for. In your case this is the subs domain and the mail host. However the host you specify obviously needs to resolve to something (which it doesnt in your case and which is the problem) and thats why you need the A record for.


Okay, great, thank you, it’s starting to make sense. However, when I try to do an A record, it gets rejected if it’s the same ip, which this would be (same as It only takes ip addresses, not anything like (gives the error: “You must enter a valid IPv4 address.”)

Also, since I want only email going to to be affected, should I change the MX record to or Or leave it as it is?

And, does the entry under “name” matter? (First column after “MX”.)


Yes, an A record requires an IP address. I am afraid I am not quite sure what you are trying to do.

You need to create an A record for mail and point it to the IP address of your mail server.

Maybe post a screenshot of what you are trying to enter.


Ah, the A record worked. Now, I get a warning about the MX record (screenshot attached), same if I change it to, however works without a warning. Is that how I should leave the MX record then?


Again, your MX record is fine and does not need any changes. You need to create the A record which is not shown in your screenshot.


Here’s a screenshot showing both. I changed the MX record, because of the warning to what you see. Do you think this will work?


Well, now you do have the A record but also changed the MX record to and now that record does not exist.


Well, what about that warning if I change it back? Sounds pretty ominous: “This record is exposing your origin server’s IP address, potentially exposing it to denial of service.” How do I resolve this problem?


The warning is something you wont be able to avoid. The host behind an MX record will always have to be visible as it cannot be proxied via Cloudflare. All you could do is point it to move your mail server to another IP address (than your webserver’s) and “expose” that one instead.

1 Like

Okay, it’s getting confusing again. Why do the other MX records not have warnings then? And how can I point it to another IP address? You don’t mean ‘fake’ it somehow, I’d have to obtain another one? And if that one is exposed, how does that help me? Just because it’s not the webserver’s address, therefore, they can’t do a denial of service to my website?

Is there any other way out of this mess?


The other MX records do not point to records which are managed by Cloudflare, so they are automatically “exposed” or not (depends on your point of view). They simply are not managed by Cloudflare, hence no warning.

You cant use a fake address you need to point it to the address where you mail server is running. That is right now probably the same machine as where you webserver is running and in that way you’d “expose” that address, hence the warning. If you want to keep your webserver behind Cloudflare you will need to contact your host and ask for a second IP address or point it somewhere completely different.


Okay, thanks for all your help.

closed #16

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.