0

I am a bit confused with regards to MX and wildcard-A-entries in a dns zone.

Imagine a zone foobar.com with these dns settings (NS set is there, leaving out)

foobar.com IN A 1.2.3.4
*.foobar.com IN A 1.2.3.4

foobar.com IN MX 10 mail.otherhost.com

When sending mail to [email protected] this goes to mail.otherhost.com. All right.

When sending mail to [email protected] this goes to 1.2.3.4.

As I understand this is correct with https://www.ietf.org/rfc/rfc1912.txt there "2.7 Wildcard records" and the example (its vice versa, but anyway).

My question now is: How do MTAs like Postfix "strip" the subdomain part from the host part when getting ("resolving") the MX host?

My problem of understanding is: If the top level domain is .com, this is simple. Host ist the part before .com. But there are many top level domains with sub-top-level, e.g. .co.at (Austria).

Any ideas?

1 Answer 1

0

How do MTAs like Postfix "strip" the subdomain part from the host part when getting ("resolving") the MX host?

They don't. The MX record for an address is requested. If one doesn't exist the A record is used to determine the target IP address.

In your example you have [email protected], where the subdomain for delivery is some-subdomain.foobar.com. The sending MTA requests an MX for this address. In your example there isn't one so the A record is requested. There isn't one but the wildcard *.foobar.com is matched, which returns an address of 1.2.3.4. This is the address to which delivery is attempted.

CNAME records make this a little more complicated, but not much: if there is a CNAME then it is resolved before anything else. (This is why you cannot have a CNAME and an MX for the same domain entry.)

1
  • Thank you so much! Commented Apr 14, 2022 at 6:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.