Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my Ubuntu 10.4 based vserver, I want to send and receive emails for multiple domains. As first step, it seems that I must have MX records configured correctly. As I am rather new to this: What are MX records? How do they look like for a mailserver dealing with,

Assuming the MX records, what does this command do:

netcat 25

share|improve this question
up vote 9 down vote accepted

An MX record is a DNS record which tells remote hosts the DNS names of the machines that accept e-mail for the domain. Each domain which you wish to receive e-mail for needs to have appropriate MX records. For your setup you probably want to have just a single MX record per domain, but you can set up multiple records with different priorities if you have backup mail servers.

This is a separate record type, so it won't show up in a "netcat". You have to explicitly request the MX record type. For example:

$ host -t mx mail is handled by 20 mail is handled by 10 mail is handled by 40 mail is handled by 5 mail is handled by 30

This shows several different mail server names that can be used to deliver mail to users at, with different priorities (5 being the most preferred). Observe that the MX record is on the domain itself ("") rather than on the mail host ("").

Note that if an MX record can't be found, the A record for the domain name will be used. So, if your mail server is on the same IP address as the other services, you could get by with just an A record. However, I'd recommend adding an MX record in any case, just to be clear and prevent changes to DNS from having unintended consequences.

DNS records, including MX records, are set up using whatever management interfaces your DNS hosting service provides. Often these are web interfaces, though if you are hosting your own DNS this would be in the zone files or database.

Note that backup mail servers are often abused by spammers, who try them to see if they are less strict about anti-spam measures, so make sure backup mail servers have similarly strict settings.

See Wikipedia's page on MX records for more detailed information

share|improve this answer

Your Answer


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.