Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am wondering if I need my own DNS in order to receive emails on my Ubuntu VPS? I am currently using name.com's DNS with my domain and pointing it with A records to my server, and that works for viewing my site but I can only send mail from the server from www-data@mydomain.com. How can I receive mail from other people without setting up my own DNS?

Could I have an MX record (from name.com) pointing to my server? The point is, I don't want to have to set up my own DNS (like bind9 or anything).

share|improve this question

4 Answers 4

You do not need to run your own DNS server. It is customary to have a so-called MX record describing how to deliver mail to addresses in that domain, but it is not strictly necessary. This is how it works:

A mailserver that wants to deliver mail to your server asks its DNS server for an MX record:

$ host -t MX mydomain.com
mydomain.com           MX      10 mail.mydomain.com
mydomain.com           MX      20 wicker.mydomain.com

It selects one and asks for its IP address:

$ host -t A mail.mydomain.com
mail.mydomain.com      A       1.2.3.4

However, the mail RFC specifies that if there is no MX (first step comes up empty) it should go look for the IP address directly:

$ host -t A mydomain.com
mydomain.com           A       2.3.4.5

Which means, that you can mail to e.g. www.mydomain.com and mail servers will try to deliver to that web server.

EDIT: To clarify: the MX record can live in any DNS server whatever. Or, put differently, it must live in exactly the DNS server that is master for the domain the MX record wants to be in.

share|improve this answer

You will have to add to your domain zone an MX resource record pointing to your IP address. You will have to do this using the tools your current DNS provider makes available to you (hopefully).

share|improve this answer

If you have an A record for a domain, the MTAs will use that IP address to deliver the mail for your domain. MX record is not mandatory.

share|improve this answer

As I understand it, mail servers do not require their own DNS servers. That said, the server the email service exists on DOES require access to a DNS server to resolve Names-to-IP's.

What ever you decide to do with your DNS (in house/local or external), you will need to make sure the A record is always up-to-date and that at least one MX record exists.

Now, if you asking 'why can't someone from xxx@abc.com.au send an email to me @ me@mydomain.com .. then you will need to check the email services incoming (ie. SMTP) accept permissions.

You can use a service like MXToolBox to test your SMTP email-receiving service is working correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.