A Question about resolving MX Records...

Hello,
I have a program I've written which queries name servers for MX Records of domains, and then does the lookup of the A Record from the response. My question is this... if the mx lookup returns no results what should happen? Should I just query the A record for the given domain and try to send mail to that IP, or do I do nothing and consider it a bad domain? Whats RFC dictate? I cant really find anything about it.

Thanks,
Rick
richardsimnettAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BrianMilnesCommented:
Hi,
I don't know what the RFC states, but it is perfectly legitimate to not set an MX record for a domain. It may be bad practice, but the DNS record can have an empty MX record. Not every domain has to have an associated e-mail service/host. Sending mail to the A record in such circumstances would be pointless...

Brian
0
sentnerCommented:
Not completely pointless.  Mail servers (such as sendmail) will attempt to send directly to a host name if it exists when it can't find an MX record.  In other words, it will do an A record lookup against the domain name.    See:  http://en.wikipedia.org/wiki/MX_record#MX_Record_and_spam under the section on MX Record and Spam.

Here's the RFC for reference:  http://tools.ietf.org/html/rfc2821
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BrianMilnesCommented:
Yes, I see the article suggests that not having an MX record but having an e-mail server on the A record host is a way of avoiding some SPAM. And you cite the RFC, that specifies reverting to the A record in the absence of MX records. Thanks for the correction.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DNS

From novice to tech pro — start learning today.