Do CNAME records also forward MX requests?

▼魔方 西西 提交于 2019-12-22 01:26:50

问题


My DNS has a set up for the domain base.com that consists of A and MX records. There are several other domains that are set up with CNAME records, pointing to base.com. Do I need to set up anything special (like extra MX records) for the CNAME domains, or will the CNAME records also forward any MX requests.

Example:
Will an email sent to info@otherdomain.com be delivered correctly to the MX of base.com if these (and only these) DNS records are in place:

; A and MX set up for base.com
base.com.  3600  IN  A  123.45.67.89
mail.base.com.  3600  A  123.45.67.89
base.com.  3600  IN  MX  10  mail.base.com.
; CNAME set up for otherdomain.com
otherdomain.com. CNAME  IN  A  base.com.

回答1:


CNAME causes queries for all RR types (excluding CNAME itself) to be directed to the target name. That includes MX. So yes, the above zone data will cause queries for otherdomain.com.'s MX to resolve to mail.base.com..

Experiment with dig or your favorite DNS client. Not only will you confirm the result for sure, but you won't have to wait 4 hours for someone to answer your SO question before you get your answer!

Unfortunately, in this particular case, if your domain is really of the form otherdomain.com., you would not be able to configure a CNAME resource records for it. This is because domains that have CNAME records cannot have any other type of resource record at the same time. Yet if otherdomain.com. is directly below com. (or another gTLD), it is necessarily at the top of a zone and so it needs at least SOA and NS records.



来源:https://stackoverflow.com/questions/12204360/do-cname-records-also-forward-mx-requests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!